From 218eed2104e491a49ff6282405aea293051b6ab3 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 5 Dec 2024 22:56:20 +0900 Subject: [PATCH] fix clippy errors due to update to `needless_lifetimes` at Rust 1.83 --- v2/src/config.rs | 2 +- v2/src/markdown/parser.rs | 4 ++-- v2/src/markdown/search.rs | 6 +++--- v2/src/persistent.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/v2/src/config.rs b/v2/src/config.rs index 7bcd98f..dfef043 100644 --- a/v2/src/config.rs +++ b/v2/src/config.rs @@ -443,7 +443,7 @@ mod tests { } } - impl<'a> Drop for Env<'a> { + impl Drop for Env<'_> { fn drop(&mut self) { let Self((name, saved)) = &self; if let Some(saved) = saved { diff --git a/v2/src/markdown/parser.rs b/v2/src/markdown/parser.rs index 7a09e29..d06443f 100644 --- a/v2/src/markdown/parser.rs +++ b/v2/src/markdown/parser.rs @@ -142,7 +142,7 @@ impl<'input, V: TextVisitor, T: TextTokenizer> MarkdownParser<'input, V, T> { // Note: Build raw JavaScript expression which is evaluated to the render tree encoded as JSON value. // This expression will be evaluated via `receive(JSON.parse('{"kind":"render_tree",...}'))` by renderer. -impl<'input, V: TextVisitor, T: TextTokenizer> RawMessageWriter for MarkdownParser<'input, V, T> { +impl RawMessageWriter for MarkdownParser<'_, V, T> { type Output = V; fn write_to(self, writer: impl Write) -> Result { @@ -289,7 +289,7 @@ where } } -impl<'events, 'input, I> Read for InlineHtmlReader<'events, 'input, I> +impl<'input, I> Read for InlineHtmlReader<'_, 'input, I> where I: Iterator, Range)>, { diff --git a/v2/src/markdown/search.rs b/v2/src/markdown/search.rs index 429e1a9..e38c957 100644 --- a/v2/src/markdown/search.rs +++ b/v2/src/markdown/search.rs @@ -20,7 +20,7 @@ impl MatchPosition for AhoCorasickMatch { } } -impl<'text> MatchPosition for RegexMatch<'text> { +impl MatchPosition for RegexMatch<'_> { fn start(&self) -> usize { self.start() } @@ -194,7 +194,7 @@ pub struct MatchTokenizer<'a> { index: Option, } -impl<'a> MatchTokenizer<'a> { +impl MatchTokenizer<'_> { fn next(&mut self) -> bool { let Some((h, t)) = self.tail.split_first() else { return false; @@ -225,7 +225,7 @@ impl<'a> MatchTokenizer<'a> { } } -impl<'a> TextTokenizer for MatchTokenizer<'a> { +impl TextTokenizer for MatchTokenizer<'_> { fn tokenize<'t>(&mut self, text: &'t str, range: &Range) -> (TokenKind, &'t str) { debug_assert_eq!(text.len(), range.len(), "text={:?} range={:?}", text, range); let Range { start, end } = *range; diff --git a/v2/src/persistent.rs b/v2/src/persistent.rs index 4d728de..a0ffa7f 100644 --- a/v2/src/persistent.rs +++ b/v2/src/persistent.rs @@ -93,7 +93,7 @@ pub struct RecentFiles<'a> { pub paths: Vec<&'a Path>, } -impl<'a> PersistentData for RecentFiles<'a> { +impl PersistentData for RecentFiles<'_> { const FILE: &'static str = "recent_files.json"; }