From 96b7483138557ceb0171b8dcb9dd409c9f567450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Jan 2021 14:19:47 +0100 Subject: [PATCH] clippy: remove/replace needless explicit lifetimes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/pxar/fuse.rs | 12 ++++++------ src/tools/lru_cache.rs | 2 +- src/tools/systemd/time.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pxar/fuse.rs b/src/pxar/fuse.rs index 2037a484..a5001cbe 100644 --- a/src/pxar/fuse.rs +++ b/src/pxar/fuse.rs @@ -480,11 +480,11 @@ impl SessionImpl { Ok(()) } - async fn lookup<'a>( - &'a self, + async fn lookup( + &'_ self, parent: u64, file_name: &OsStr, - ) -> Result<(EntryParam, LookupRef<'a>), Error> { + ) -> Result<(EntryParam, LookupRef<'_>), Error> { let dir = self.open_dir(parent).await?; let entry = match { dir }.lookup(file_name).await? { @@ -519,10 +519,10 @@ impl SessionImpl { to_stat(inode, &entry) } - async fn readdirplus<'a>( - &'a self, + async fn readdirplus( + &'_ self, request: &mut requests::ReaddirPlus, - ) -> Result>, Error> { + ) -> Result>, Error> { let mut lookups = Vec::new(); let offset = usize::try_from(request.offset) .map_err(|_| io_format_err!("directory offset out of range"))?; diff --git a/src/tools/lru_cache.rs b/src/tools/lru_cache.rs index 1033dd42..19012976 100644 --- a/src/tools/lru_cache.rs +++ b/src/tools/lru_cache.rs @@ -173,7 +173,7 @@ impl LruCache { /// Get a mutable reference to the value identified by `key`. /// This will update the cache entry to be the most recently used entry. /// On cache misses, None is returned. - pub fn get_mut<'a>(&'a mut self, key: K) -> Option<&'a mut V> { + pub fn get_mut(&mut self, key: K) -> Option<&mut V> { let node_ptr = self.map.get(&key)?; self.list.bring_to_front(*node_ptr); Some(unsafe { &mut (*self.list.head).value }) diff --git a/src/tools/systemd/time.rs b/src/tools/systemd/time.rs index 02395724..7cc42415 100644 --- a/src/tools/systemd/time.rs +++ b/src/tools/systemd/time.rs @@ -142,7 +142,7 @@ impl From for f64 { } -pub fn verify_time_span<'a>(i: &'a str) -> Result<(), Error> { +pub fn verify_time_span(i: &str) -> Result<(), Error> { parse_time_span(i)?; Ok(()) }