]> git.lizzy.rs Git - rust.git/commitdiff
Typos
authorErlend Tobiassen <erlend.tobiassen@gmail.com>
Sun, 27 Jan 2019 13:49:02 +0000 (14:49 +0100)
committerErlend Tobiassen <erlend.tobiassen@gmail.com>
Sun, 27 Jan 2019 14:19:42 +0000 (15:19 +0100)
crates/ra_syntax/src/algo.rs

index 45747e21d4dc479a54ad67f12a0c94c465ed5ea1..99b0983b0d8ecaa8cb0656916d96eb38344069fe 100644 (file)
@@ -17,14 +17,14 @@ pub fn find_leaf_at_offset(node: &SyntaxNode, offset: TextUnit) -> LeafAtOffset<
 }
 
 /// Finds a node of specific Ast type at offset. Note that this is slightly
-/// impercise: if the cursor is strictly betwen two nodes of the desired type,
+/// imprecise: if the cursor is strictly between two nodes of the desired type,
 /// as in
 ///
 /// ```no-run
 /// struct Foo {}|struct Bar;
 /// ```
 ///
-/// then the left node will be silently prefered.
+/// then the left node will be silently preferred.
 pub fn find_node_at_offset<N: AstNode>(syntax: &SyntaxNode, offset: TextUnit) -> Option<&N> {
     find_leaf_at_offset(syntax, offset).find_map(|leaf| leaf.ancestors().find_map(N::cast))
 }