[pbs-devel] [PATCH pxar 2/3] tree wide: elide explicit lifetimes reported by cargo clippy

Christian Ebner c.ebner at proxmox.com
Wed Aug 27 11:46:32 CEST 2025


Code style cleanup only, no functional changes.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 src/accessor/aio.rs     |  2 +-
 src/accessor/mod.rs     |  4 ++--
 src/accessor/read_at.rs |  6 +++---
 src/accessor/sync.rs    |  6 +++---
 src/decoder/aio.rs      |  2 +-
 src/decoder/mod.rs      |  4 ++--
 src/decoder/sync.rs     |  2 +-
 src/encoder/aio.rs      |  4 ++--
 src/encoder/mod.rs      | 10 +++++-----
 src/encoder/sync.rs     |  4 ++--
 10 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/accessor/aio.rs b/src/accessor/aio.rs
index 7cd7f87..827289a 100644
--- a/src/accessor/aio.rs
+++ b/src/accessor/aio.rs
@@ -317,7 +317,7 @@ pub struct DirEntry<'a, T: Clone + ReadAt> {
     inner: accessor::DirEntryImpl<'a, T>,
 }
 
-impl<'a, T: Clone + ReadAt> DirEntry<'a, T> {
+impl<T: Clone + ReadAt> DirEntry<'_, T> {
     /// Get the current file name.
     pub fn file_name(&self) -> &Path {
         self.inner.file_name()
diff --git a/src/accessor/mod.rs b/src/accessor/mod.rs
index dd8aece..3605fd9 100644
--- a/src/accessor/mod.rs
+++ b/src/accessor/mod.rs
@@ -112,7 +112,7 @@ where
 }
 
 /// Allow using trait objects for `T: ReadAt`
-impl<'d> ReadAt for &(dyn ReadAt + 'd) {
+impl ReadAt for &(dyn ReadAt + '_) {
     fn start_read_at<'a>(
         self: Pin<&'a Self>,
         cx: &mut Context,
@@ -873,7 +873,7 @@ pub(crate) struct DirEntryImpl<'a, T: Clone + ReadAt> {
     caches: Arc<Caches>,
 }
 
-impl<'a, T: Clone + ReadAt> DirEntryImpl<'a, T> {
+impl<T: Clone + ReadAt> DirEntryImpl<'_, T> {
     pub fn file_name(&self) -> &Path {
         &self.file_name
     }
diff --git a/src/accessor/read_at.rs b/src/accessor/read_at.rs
index d1d2e9b..4d2458b 100644
--- a/src/accessor/read_at.rs
+++ b/src/accessor/read_at.rs
@@ -73,7 +73,7 @@ pub struct ReadAtOperation<'a> {
     _marker: PhantomData<&'a mut [u8]>,
 }
 
-impl<'a> ReadAtOperation<'a> {
+impl ReadAtOperation<'_> {
     /// Create a new [`ReadAtOperation`].
     pub fn new<T: Into<Box<dyn Any + Send + Sync>>>(cookie: T) -> Self {
         Self {
@@ -112,7 +112,7 @@ impl<'a, T: ReadAt> ReadAtImpl<'a, T> {
     }
 }
 
-impl<'a, T: ReadAt> Future for ReadAtImpl<'a, T> {
+impl<T: ReadAt> Future for ReadAtImpl<'_, T> {
     type Output = io::Result<usize>;
 
     fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
@@ -132,7 +132,7 @@ impl<T: ReadAt> ReadAtState<'_, T> {
     }
 }
 
-impl<'a, T: ReadAt> Future for ReadAtState<'a, T> {
+impl<T: ReadAt> Future for ReadAtState<'_, T> {
     type Output = io::Result<usize>;
 
     fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
diff --git a/src/accessor/sync.rs b/src/accessor/sync.rs
index 93b26d0..ad82503 100644
--- a/src/accessor/sync.rs
+++ b/src/accessor/sync.rs
@@ -339,7 +339,7 @@ pub struct ReadDir<'a, T> {
     inner: accessor::ReadDirImpl<'a, T>,
 }
 
-impl<'a, T: Clone + ReadAt> ReadDir<'a, T> {
+impl<T: Clone + ReadAt> ReadDir<'_, T> {
     /// Efficient alternative to `Iterator::skip`.
     #[inline]
     pub fn skip(self, n: usize) -> Self {
@@ -367,7 +367,7 @@ impl<'a, T: Clone + ReadAt> Iterator for ReadDir<'a, T> {
     }
 }
 
-impl<'a, T: Clone + ReadAt> std::iter::FusedIterator for ReadDir<'a, T> {}
+impl<T: Clone + ReadAt> std::iter::FusedIterator for ReadDir<'_, T> {}
 
 /// A directory entry. When iterating through the contents of a directory we first get access to
 /// the file name. The remaining information can be decoded afterwards.
@@ -376,7 +376,7 @@ pub struct DirEntry<'a, T: Clone + ReadAt> {
     inner: accessor::DirEntryImpl<'a, T>,
 }
 
-impl<'a, T: Clone + ReadAt> DirEntry<'a, T> {
+impl<T: Clone + ReadAt> DirEntry<'_, T> {
     /// Get the current file name.
     pub fn file_name(&self) -> &Path {
         self.inner.file_name()
diff --git a/src/decoder/aio.rs b/src/decoder/aio.rs
index 19e7023..21ea571 100644
--- a/src/decoder/aio.rs
+++ b/src/decoder/aio.rs
@@ -109,7 +109,7 @@ mod tok {
         }
     }
 
-    impl<'a, T: crate::decoder::SeqRead> tokio::io::AsyncRead for Contents<'a, T> {
+    impl<T: crate::decoder::SeqRead> tokio::io::AsyncRead for Contents<'_, T> {
         fn poll_read(
             self: Pin<&mut Self>,
             cx: &mut Context<'_>,
diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs
index c6a0cda..d62d030 100644
--- a/src/decoder/mod.rs
+++ b/src/decoder/mod.rs
@@ -68,7 +68,7 @@ pub trait SeqRead {
 }
 
 /// Allow using trait objects for generics taking a `SeqRead`:
-impl<'a> SeqRead for &mut (dyn SeqRead + 'a) {
+impl SeqRead for &mut (dyn SeqRead + '_) {
     fn poll_seq_read(
         self: Pin<&mut Self>,
         cx: &mut Context,
@@ -848,7 +848,7 @@ impl<'a, T: SeqRead> Contents<'a, T> {
     }
 }
 
-impl<'a, T: SeqRead> SeqRead for Contents<'a, T> {
+impl<T: SeqRead> SeqRead for Contents<'_, T> {
     fn poll_seq_read(
         mut self: Pin<&mut Self>,
         cx: &mut Context,
diff --git a/src/decoder/sync.rs b/src/decoder/sync.rs
index 1116fe8..2c6ab4e 100644
--- a/src/decoder/sync.rs
+++ b/src/decoder/sync.rs
@@ -133,7 +133,7 @@ pub struct Contents<'a, T: SeqRead> {
     inner: decoder::Contents<'a, T>,
 }
 
-impl<'a, T: SeqRead> io::Read for Contents<'a, T> {
+impl<T: SeqRead> io::Read for Contents<'_, T> {
     fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
         poll_result_once(super::seq_read(&mut self.inner, buf))
     }
diff --git a/src/encoder/aio.rs b/src/encoder/aio.rs
index 8973402..66cb7ed 100644
--- a/src/encoder/aio.rs
+++ b/src/encoder/aio.rs
@@ -220,7 +220,7 @@ pub struct File<'a, S: SeqWrite> {
     inner: encoder::FileImpl<'a, S>,
 }
 
-impl<'a, S: SeqWrite> File<'a, S> {
+impl<S: SeqWrite> File<'_, S> {
     /// Get the file offset to be able to reference it with `add_hardlink`.
     pub fn file_offset(&self) -> LinkOffset {
         self.inner.file_offset()
@@ -238,7 +238,7 @@ impl<'a, S: SeqWrite> File<'a, S> {
 }
 
 #[cfg(feature = "tokio-io")]
-impl<'a, S: SeqWrite> tokio::io::AsyncWrite for File<'a, S> {
+impl<S: SeqWrite> tokio::io::AsyncWrite for File<'_, S> {
     fn poll_write(self: Pin<&mut Self>, cx: &mut Context, data: &[u8]) -> Poll<io::Result<usize>> {
         unsafe { self.map_unchecked_mut(|this| &mut this.inner) }.poll_write(cx, data)
     }
diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs
index 0c17aa3..4e7daef 100644
--- a/src/encoder/mod.rs
+++ b/src/encoder/mod.rs
@@ -292,7 +292,7 @@ pub(crate) enum EncoderOutput<'a, T> {
     Borrowed(&'a mut T),
 }
 
-impl<'a, T> std::convert::AsMut<T> for EncoderOutput<'a, T> {
+impl<T> std::convert::AsMut<T> for EncoderOutput<'_, T> {
     fn as_mut(&mut self) -> &mut T {
         match self {
             EncoderOutput::Owned(o) => o,
@@ -301,7 +301,7 @@ impl<'a, T> std::convert::AsMut<T> for EncoderOutput<'a, T> {
     }
 }
 
-impl<'a, T> std::convert::From<T> for EncoderOutput<'a, T> {
+impl<T> std::convert::From<T> for EncoderOutput<'_, T> {
     fn from(t: T) -> Self {
         EncoderOutput::Owned(t)
     }
@@ -1090,7 +1090,7 @@ pub(crate) struct FileImpl<'a, S: SeqWrite> {
     parent: &'a mut EncoderState,
 }
 
-impl<'a, S: SeqWrite> Drop for FileImpl<'a, S> {
+impl<S: SeqWrite> Drop for FileImpl<'_, S> {
     fn drop(&mut self) {
         if self.remaining_size != 0 {
             self.parent.add_error(EncodeError::IncompleteFile);
@@ -1100,7 +1100,7 @@ impl<'a, S: SeqWrite> Drop for FileImpl<'a, S> {
     }
 }
 
-impl<'a, S: SeqWrite> FileImpl<'a, S> {
+impl<S: SeqWrite> FileImpl<'_, S> {
     /// Get the file offset to be able to reference it with `add_hardlink`.
     pub fn file_offset(&self) -> LinkOffset {
         LinkOffset(self.goodbye_item.offset)
@@ -1200,7 +1200,7 @@ impl<'a, S: SeqWrite> FileImpl<'a, S> {
 }
 
 #[cfg(feature = "tokio-io")]
-impl<'a, S: SeqWrite> tokio::io::AsyncWrite for FileImpl<'a, S> {
+impl<S: SeqWrite> tokio::io::AsyncWrite for FileImpl<'_, S> {
     fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll<io::Result<usize>> {
         FileImpl::poll_write(self, cx, buf)
     }
diff --git a/src/encoder/sync.rs b/src/encoder/sync.rs
index af2f902..ee04b07 100644
--- a/src/encoder/sync.rs
+++ b/src/encoder/sync.rs
@@ -221,14 +221,14 @@ pub struct File<'a, S: SeqWrite> {
     inner: encoder::FileImpl<'a, S>,
 }
 
-impl<'a, S: SeqWrite> File<'a, S> {
+impl<S: SeqWrite> File<'_, S> {
     /// Get the file offset to be able to reference it with `add_hardlink`.
     pub fn file_offset(&self) -> LinkOffset {
         self.inner.file_offset()
     }
 }
 
-impl<'a, S: SeqWrite> io::Write for File<'a, S> {
+impl<S: SeqWrite> io::Write for File<'_, S> {
     fn write(&mut self, data: &[u8]) -> io::Result<usize> {
         poll_result_once(self.inner.write(data))
     }
-- 
2.47.2





More information about the pbs-devel mailing list