From f45924cdca24bac7c617d1ac3981f457795c5889 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sat, 28 Sep 2024 07:11:54 +0800 Subject: [PATCH] Fix typos --- src/api.rs | 4 ++-- src/cursor.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.rs b/src/api.rs index 03b2cc23..ccfb0a58 100644 --- a/src/api.rs +++ b/src/api.rs @@ -214,7 +214,7 @@ impl SyntaxNode { } /// Find a token in the subtree corresponding to this node, which covers the offset. - /// Precondition: offset must be withing node's range. + /// Precondition: offset must be within node's range. pub fn token_at_offset(&self, offset: TextSize) -> TokenAtOffset> { self.raw.token_at_offset(offset).map(SyntaxToken::from) } @@ -222,7 +222,7 @@ impl SyntaxNode { /// Return the deepest node or token in the current subtree that fully /// contains the range. If the range is empty and is contained in two leaf /// nodes, either one can be returned. Precondition: range must be contained - /// withing the current node + /// within the current node pub fn covering_element(&self, range: TextRange) -> SyntaxElement { NodeOrToken::from(self.raw.covering_element(range)) } diff --git a/src/cursor.rs b/src/cursor.rs index 3b849582..f7faf27a 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -478,7 +478,7 @@ impl NodeData { match self.green() { NodeOrToken::Node(green) => { - // Child is root, so it ownes the green node. Steal it! + // Child is root, so it owns the green node. Steal it! let child_green = match &child.green { Green::Node { ptr } => unsafe { GreenNode::from_raw(ptr.get()).into() }, Green::Token { ptr } => unsafe { GreenToken::from_raw(*ptr).into() },