Skip to content

Conversation

@sile
Copy link
Owner

@sile sile commented Nov 1, 2025

Fix #7

@sile sile requested a review from Copilot November 1, 2025 12:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the node_ref and node_mut methods to be marked as unsafe, requiring callers to explicitly acknowledge the unsafe operation when accessing nodes by index. Previously, these methods were safe wrappers around unsafe operations, which could lead to incorrect usage if indices are out of bounds.

Key changes:

  • Mark node_ref and node_mut as unsafe fn to make the safety requirements explicit
  • Add unsafe blocks at all call sites throughout the codebase
  • Refactor some complex pointer dereferencing code for clarity

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tree_core.rs Changed node_ref and node_mut signatures to unsafe fn and updated all internal call sites with unsafe blocks
src/vec_like.rs Updated calls to node_ref and node_mut to use unsafe blocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sile sile merged commit df3225c into master Nov 1, 2025
10 checks passed
@sile sile deleted the issue-7 branch November 1, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible unsound unsafe API usages

2 participants