clippy: remove/replace needless explicit lifetimes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-19 14:19:47 +01:00
parent 81281d04a4
commit 96b7483138
3 changed files with 8 additions and 8 deletions

View File

@ -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<Vec<LookupRef<'a>>, Error> {
) -> Result<Vec<LookupRef<'_>>, Error> {
let mut lookups = Vec::new();
let offset = usize::try_from(request.offset)
.map_err(|_| io_format_err!("directory offset out of range"))?;

View File

@ -173,7 +173,7 @@ impl<K: std::cmp::Eq + std::hash::Hash + Copy, V> LruCache<K, V> {
/// 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 })

View File

@ -142,7 +142,7 @@ impl From<TimeSpan> 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(())
}