diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-27 18:53:09 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-27 18:53:09 +0200 |
| commit | 6ebe6218343a520dce2a5e560edbdc6fa0e9e44b (patch) | |
| tree | 9c5b5f20b86d14bd6ee452878b8f00b0e5dcf987 /src/parse | |
| parent | 39a561f2bbb0b37eb5ce67e9735b01d0b75477cf (diff) | |
Use last instead of next_back
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/scanner.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/parse/scanner.rs b/src/parse/scanner.rs index c9c94769..9ee7641c 100644 --- a/src/parse/scanner.rs +++ b/src/parse/scanner.rs @@ -109,10 +109,7 @@ impl<'s> Scanner<'s> { /// The previous index in the source string. #[inline] pub fn last_index(&self) -> usize { - self.eaten() - .chars() - .next_back() - .map_or(0, |c| self.index - c.len_utf8()) + self.eaten().chars().last().map_or(0, |c| self.index - c.len_utf8()) } /// The current index in the source string. |
