diff options
author | Alan Du <[email protected]> | 2018-10-18 00:25:37 +0100 |
---|---|---|
committer | Alan Du <[email protected]> | 2018-10-18 00:42:23 +0100 |
commit | a5da770ec60a73abcc5350f25146be973540063f (patch) | |
tree | d0384d6a786c3a07689dc4dff04209207487b76b /crates/ra_syntax | |
parent | fc8024de51261d252b1ad88566db6e246d14ee16 (diff) |
Fix function calls
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/lexer/ptr.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/reparsing.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/utils.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/lexer/ptr.rs b/crates/ra_syntax/src/lexer/ptr.rs index fa79d8862..4c291b9c4 100644 --- a/crates/ra_syntax/src/lexer/ptr.rs +++ b/crates/ra_syntax/src/lexer/ptr.rs | |||
@@ -31,7 +31,7 @@ impl<'s> Ptr<'s> { | |||
31 | /// For example, 0 will return the current token, 1 will return the next, etc. | 31 | /// For example, 0 will return the current token, 1 will return the next, etc. |
32 | pub fn nth(&self, n: u32) -> Option<char> { | 32 | pub fn nth(&self, n: u32) -> Option<char> { |
33 | let mut chars = self.chars().peekable(); | 33 | let mut chars = self.chars().peekable(); |
34 | chars.by_ref().skip(n as usize).next() | 34 | chars.by_ref().nth(n as usize) |
35 | } | 35 | } |
36 | 36 | ||
37 | /// Checks whether the current character is `c`. | 37 | /// Checks whether the current character is `c`. |
diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs index 377152de4..eae01b1d5 100644 --- a/crates/ra_syntax/src/reparsing.rs +++ b/crates/ra_syntax/src/reparsing.rs | |||
@@ -135,7 +135,7 @@ fn find_reparsable_node( | |||
135 | } | 135 | } |
136 | 136 | ||
137 | fn is_balanced(tokens: &[Token]) -> bool { | 137 | fn is_balanced(tokens: &[Token]) -> bool { |
138 | if tokens.len() == 0 | 138 | if tokens.is_empty() |
139 | || tokens.first().unwrap().kind != L_CURLY | 139 | || tokens.first().unwrap().kind != L_CURLY |
140 | || tokens.last().unwrap().kind != R_CURLY | 140 | || tokens.last().unwrap().kind != R_CURLY |
141 | { | 141 | { |
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs index ca4160378..8ee02724d 100644 --- a/crates/ra_syntax/src/utils.rs +++ b/crates/ra_syntax/src/utils.rs | |||
@@ -5,7 +5,7 @@ use std::fmt::Write; | |||
5 | 5 | ||
6 | /// Parse a file and create a string representation of the resulting parse tree. | 6 | /// Parse a file and create a string representation of the resulting parse tree. |
7 | pub fn dump_tree(syntax: SyntaxNodeRef) -> String { | 7 | pub fn dump_tree(syntax: SyntaxNodeRef) -> String { |
8 | let mut errors: Vec<_> = syntax.root_data().iter().cloned().collect(); | 8 | let mut errors: Vec<_> = syntax.root_data().to_vec(); |
9 | errors.sort_by_key(|e| e.offset); | 9 | errors.sort_by_key(|e| e.offset); |
10 | let mut err_pos = 0; | 10 | let mut err_pos = 0; |
11 | let mut level = 0; | 11 | let mut level = 0; |