Skip to content

Commit

Permalink
refactor(traverse): correct code comments (#5293)
Browse files Browse the repository at this point in the history
#5286 changed `TraverseCtx::ancestor` to always return an `Ancestor`. Update doc comments to reflect that.
  • Loading branch information
overlookmotel committed Aug 28, 2024
1 parent 292d162 commit b43a394
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_traverse/src/context/ancestry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'a> TraverseAncestry<'a> {
/// Get ancestor of current node.
///
/// `level` is number of levels above.
/// `ancestor(1).unwrap()` is equivalent to `parent()`.
/// `ancestor(1)` is equivalent to `parent()`.
///
/// If `level` is out of bounds (above `Program`), returns `Ancestor::None`.
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_traverse/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<'a> TraverseCtx<'a> {
/// Get ancestor of current node.
///
/// `level` is number of levels above.
/// `ancestor(1).unwrap()` is equivalent to `parent()`.
/// `ancestor(1)` is equivalent to `parent()`.
///
/// If `level` is out of bounds (above `Program`), returns `Ancestor::None`.
///
Expand Down

0 comments on commit b43a394

Please sign in to comment.