mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Add lots of tests
This commit is contained in:
parent
fdb9f06880
commit
94796e6447
3 changed files with 125 additions and 6 deletions
|
@ -30,8 +30,7 @@ impl<'s> Ptr<'s> {
|
|||
/// Gets the nth character from the current.
|
||||
/// For example, 0 will return the current token, 1 will return the next, etc.
|
||||
pub fn nth(&self, n: u32) -> Option<char> {
|
||||
let mut chars = self.chars().peekable();
|
||||
chars.by_ref().nth(n as usize)
|
||||
self.chars().nth(n as usize)
|
||||
}
|
||||
|
||||
/// Checks whether the current character is `c`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue