clippy: elide more lifetimes

these were detected with 1.83.0

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-12-02 11:34:05 +01:00
parent d61bac6841
commit a50e0014df
10 changed files with 15 additions and 15 deletions

View File

@ -195,7 +195,7 @@ where
}
}
impl<'a, T, F> Iterator for ExtractorIter<'a, T, F>
impl<T, F> Iterator for ExtractorIter<'_, T, F>
where
T: pxar::decoder::SeqRead,
F: FnMut(&Path),

View File

@ -558,7 +558,7 @@ struct ChunkCacher<'a, S> {
index: &'a DynamicIndexReader,
}
impl<'a, S: ReadChunk> pbs_tools::lru_cache::Cacher<usize, CachedChunk> for ChunkCacher<'a, S> {
impl<S: ReadChunk> pbs_tools::lru_cache::Cacher<usize, CachedChunk> for ChunkCacher<'_, S> {
fn fetch(&mut self, index: usize) -> Result<Option<CachedChunk>, Error> {
let info = match self.index.chunk_info(index) {
Some(info) => info,

View File

@ -131,7 +131,7 @@ pub struct SnapshotChunkIterator<'a, F: Fn(&[u8; 32]) -> bool> {
current_index: Option<(Arc<Box<dyn IndexFile + Send>>, usize, Vec<(usize, u64)>)>,
}
impl<'a, F: Fn(&[u8; 32]) -> bool> Iterator for SnapshotChunkIterator<'a, F> {
impl<F: Fn(&[u8; 32]) -> bool> Iterator for SnapshotChunkIterator<'_, F> {
type Item = Result<[u8; 32], Error>;
fn next(&mut self) -> Option<Self::Item> {

View File

@ -187,16 +187,16 @@ struct LookupRef<'a> {
lookup: *const Lookup,
}
unsafe impl<'a> Send for LookupRef<'a> {}
unsafe impl<'a> Sync for LookupRef<'a> {}
unsafe impl Send for LookupRef<'_> {}
unsafe impl Sync for LookupRef<'_> {}
impl<'a> Clone for LookupRef<'a> {
impl Clone for LookupRef<'_> {
fn clone(&self) -> Self {
self.get_ref(self.session)
}
}
impl<'a> std::ops::Deref for LookupRef<'a> {
impl std::ops::Deref for LookupRef<'_> {
type Target = Lookup;
fn deref(&self) -> &Self::Target {
@ -204,7 +204,7 @@ impl<'a> std::ops::Deref for LookupRef<'a> {
}
}
impl<'a> Drop for LookupRef<'a> {
impl Drop for LookupRef<'_> {
fn drop(&mut self) {
if self.lookup.is_null() {
return;

View File

@ -1180,7 +1180,7 @@ impl<'a> SgTapeReader<'a> {
}
}
impl<'a> BlockRead for SgTapeReader<'a> {
impl BlockRead for SgTapeReader<'_> {
fn read_block(&mut self, buffer: &mut [u8]) -> Result<usize, BlockReadError> {
if self.end_of_file {
return Err(BlockReadError::Error(proxmox_lang::io_format_err!(
@ -1212,7 +1212,7 @@ impl<'a> SgTapeWriter<'a> {
}
}
impl<'a> BlockWrite for SgTapeWriter<'a> {
impl BlockWrite for SgTapeWriter<'_> {
fn write_block(&mut self, buffer: &[u8]) -> Result<bool, std::io::Error> {
self.sg_tape.write_block(buffer)
}

View File

@ -145,7 +145,7 @@ impl<'a> ListAccessibleBackupGroups<'a> {
pub static NS_PRIVS_OK: u64 =
PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_READ | PRIV_DATASTORE_BACKUP | PRIV_DATASTORE_AUDIT;
impl<'a> Iterator for ListAccessibleBackupGroups<'a> {
impl Iterator for ListAccessibleBackupGroups<'_> {
type Item = Result<BackupGroup, Error>;
fn next(&mut self) -> Option<Self::Item> {

View File

@ -300,7 +300,7 @@ impl<'a> AcmeDomainIter<'a> {
}
}
impl<'a> Iterator for AcmeDomainIter<'a> {
impl Iterator for AcmeDomainIter<'_> {
type Item = Result<AcmeDomain, Error>;
fn next(&mut self) -> Option<Self::Item> {

View File

@ -39,7 +39,7 @@ impl<'a> MultiVolumeReader<'a> {
}
}
impl<'a> Read for MultiVolumeReader<'a> {
impl Read for MultiVolumeReader<'_> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
if self.complete {
return Ok(0);

View File

@ -46,7 +46,7 @@ impl<'a> MultiVolumeWriter<'a> {
}
}
impl<'a> TapeWrite for MultiVolumeWriter<'a> {
impl TapeWrite for MultiVolumeWriter<'_> {
fn write_all(&mut self, buf: &[u8]) -> Result<bool, std::io::Error> {
if self.finished {
proxmox_lang::io_bail!("multi-volume writer already finished: internal error");

View File

@ -125,7 +125,7 @@ impl<'a, T: TapeWrite + ?Sized> PxarTapeWriter<'a, T> {
}
}
impl<'a, T: TapeWrite + ?Sized> pxar::encoder::SeqWrite for PxarTapeWriter<'a, T> {
impl<T: TapeWrite + ?Sized> pxar::encoder::SeqWrite for PxarTapeWriter<'_, T> {
fn poll_seq_write(
self: Pin<&mut Self>,
_cx: &mut Context,