diff --git a/crates/oxc_traverse/src/context/ancestry.rs b/crates/oxc_traverse/src/context/ancestry.rs index 67790532dfc6c..6793df6248b91 100644 --- a/crates/oxc_traverse/src/context/ancestry.rs +++ b/crates/oxc_traverse/src/context/ancestry.rs @@ -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] diff --git a/crates/oxc_traverse/src/context/mod.rs b/crates/oxc_traverse/src/context/mod.rs index 6922d75e5d473..7b1665218eaeb 100644 --- a/crates/oxc_traverse/src/context/mod.rs +++ b/crates/oxc_traverse/src/context/mod.rs @@ -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`. ///