docs(transform): improve docs for TraverseCtx::ancestors_depth (#3194)

Update doc comment to clarify what `TraverseCtx::ancestors_depth`
returns.
This commit is contained in:
overlookmotel 2024-05-07 15:15:40 +01:00 committed by GitHub
parent ed3fa399a6
commit a4f881fff4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,11 +84,9 @@ impl<'a> TraverseCtx<'a> {
None None
} }
/// Get depth of ancestry stack. /// Get depth in the AST.
/// i.e. How many nodes above this one in the tree.
/// ///
/// NB: A "no parent" ancestor above `Program` counts towards this total. /// Count includes current node. i.e. in `Program`, depth is 1.
/// The current node does not.
#[inline] #[inline]
pub fn ancestors_depth(&self) -> usize { pub fn ancestors_depth(&self) -> usize {
self.stack.len() self.stack.len()