all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH pxar 2/3] tree wide: elide explicit lifetimes reported by cargo clippy
Date: Wed, 27 Aug 2025 11:46:32 +0200	[thread overview]
Message-ID: <20250827094633.239975-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250827094633.239975-1-c.ebner@proxmox.com>

Code style cleanup only, no functional changes.

Signed-off-by: Christian Ebner <c.ebner@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



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  parent reply	other threads:[~2025-08-27  9:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  9:46 [pbs-devel] [PATCH pxar 0/3] pxar: make payload reference offset checks stricter Christian Ebner
2025-08-27  9:46 ` [pbs-devel] [PATCH pxar 1/3] tree wide: fix formatting via `cargo fmt` Christian Ebner
2025-08-27  9:46 ` Christian Ebner [this message]
2025-08-27  9:46 ` [pbs-devel] [PATCH pxar 3/3] encoder: improve consistency check for payload reference offsets Christian Ebner
2025-08-27 12:36 ` [pbs-devel] applied-series: [PATCH pxar 0/3] pxar: make payload reference offset checks stricter Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250827094633.239975-3-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal