chore: Fix warnings for Rust 1.89 (#32378)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-09 13:11:57 +02:00 committed by GitHub
parent 4ff41ba62e
commit 72bcb0beb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 102 additions and 95 deletions

View file

@ -72,25 +72,25 @@ impl<'a> MarkdownParser<'a> {
self.cursor >= self.tokens.len() - 1
}
fn peek(&self, steps: usize) -> Option<&(Event, Range<usize>)> {
fn peek(&self, steps: usize) -> Option<&(Event<'_>, Range<usize>)> {
if self.eof() || (steps + self.cursor) >= self.tokens.len() {
return self.tokens.last();
}
return self.tokens.get(self.cursor + steps);
}
fn previous(&self) -> Option<&(Event, Range<usize>)> {
fn previous(&self) -> Option<&(Event<'_>, Range<usize>)> {
if self.cursor == 0 || self.cursor > self.tokens.len() {
return None;
}
return self.tokens.get(self.cursor - 1);
}
fn current(&self) -> Option<&(Event, Range<usize>)> {
fn current(&self) -> Option<&(Event<'_>, Range<usize>)> {
return self.peek(0);
}
fn current_event(&self) -> Option<&Event> {
fn current_event(&self) -> Option<&Event<'_>> {
return self.current().map(|(event, _)| event);
}