diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-11-07 10:35:33 +0000 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-11-07 10:35:33 +0000 |
commit | 94796e6447c8af9d7444164c2175ca5dae4a563e (patch) | |
tree | 7bc99ebcc33cc272ce23823bae3a4d19ec216d34 /crates/ra_syntax/src/lexer/ptr.rs | |
parent | fdb9f06880ddcf29513a8c2855c3c576cc461014 (diff) |
Add lots of tests
Diffstat (limited to 'crates/ra_syntax/src/lexer/ptr.rs')
-rw-r--r-- | crates/ra_syntax/src/lexer/ptr.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/lexer/ptr.rs b/crates/ra_syntax/src/lexer/ptr.rs index 4c291b9c4..7e4df51aa 100644 --- a/crates/ra_syntax/src/lexer/ptr.rs +++ b/crates/ra_syntax/src/lexer/ptr.rs | |||
@@ -30,8 +30,7 @@ impl<'s> Ptr<'s> { | |||
30 | /// Gets the nth character from the current. | 30 | /// Gets the nth character from the current. |
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 | self.chars().nth(n as usize) |
34 | chars.by_ref().nth(n as usize) | ||
35 | } | 34 | } |
36 | 35 | ||
37 | /// Checks whether the current character is `c`. | 36 | /// Checks whether the current character is `c`. |