Silence redundant error on char literal that was meant to be a string in 2021 edition
This commit is contained in:
parent
6f388ef1fb
commit
ea1883d7b2
4 changed files with 20 additions and 15 deletions
|
@ -59,6 +59,15 @@ impl<'a> Cursor<'a> {
|
|||
iter.next().unwrap_or(EOF_CHAR)
|
||||
}
|
||||
|
||||
/// Peeks the third symbol from the input stream without consuming it.
|
||||
pub fn third(&self) -> char {
|
||||
// `.next()` optimizes better than `.nth(1)`
|
||||
let mut iter = self.chars.clone();
|
||||
iter.next();
|
||||
iter.next();
|
||||
iter.next().unwrap_or(EOF_CHAR)
|
||||
}
|
||||
|
||||
/// Checks if there is nothing more to consume.
|
||||
pub(crate) fn is_eof(&self) -> bool {
|
||||
self.chars.as_str().is_empty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue