From 78223ab3cadc5fb5d61cf8f253ec8da96eaa885b Mon Sep 17 00:00:00 2001 From: x10an14 Date: Tue, 2 Sep 2025 21:12:15 +0200 Subject: [PATCH] lint(vfs): don't hide elided lifetime Ref: ``` Compiling vfs v0.0.0 (/build/source/vfs) error: hiding a lifetime that's elided elsewhere is confusing --> vfs/src/lib.rs:73:17 | 73 | pub fn iter(&self) -> impl Iterator { | ^^^^^ -------- the same lifetime is hidden here | | | the lifetime is elided here | = help: the same lifetime is referred to in inconsistent ways, making the signature confusing = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]` help: use `'_` for type paths | 73 | pub fn iter(&self) -> impl Iterator> { | ++++ error: could not compile `vfs` (lib) due to 1 previous error ``` --- vfs/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vfs/src/lib.rs b/vfs/src/lib.rs index 9c13ae5..140a9e5 100644 --- a/vfs/src/lib.rs +++ b/vfs/src/lib.rs @@ -70,7 +70,7 @@ impl ReadOnlyVfs { let file_id = self.alloc_file_id(path); self.data.insert(file_id, contents.to_owned()); } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator> { self.data.keys().map(move |file_id| VfsEntry { file_id: *file_id, file_path: self.file_path(*file_id), @@ -78,7 +78,7 @@ impl ReadOnlyVfs { }) } #[must_use] - pub fn par_iter(&self) -> impl ParallelIterator { + pub fn par_iter(&self) -> impl ParallelIterator> { self.data.par_iter().map(move |(file_id, _)| VfsEntry { file_id: *file_id, file_path: self.file_path(*file_id), -- 2.51.2