From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 827A31FF183 for ; Wed, 27 Aug 2025 11:47:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 62EA416513; Wed, 27 Aug 2025 11:47:19 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 27 Aug 2025 11:46:32 +0200 Message-ID: <20250827094633.239975-3-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250827094633.239975-1-c.ebner@proxmox.com> References: <20250827094633.239975-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756287999266 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.043 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH pxar 2/3] tree wide: elide explicit lifetimes reported by cargo clippy X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Code style cleanup only, no functional changes. Signed-off-by: Christian Ebner --- 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 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, } -impl<'a, T: Clone + ReadAt> DirEntryImpl<'a, T> { +impl 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>>(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 Future for ReadAtImpl<'_, T> { type Output = io::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { @@ -132,7 +132,7 @@ impl ReadAtState<'_, T> { } } -impl<'a, T: ReadAt> Future for ReadAtState<'a, T> { +impl Future for ReadAtState<'_, T> { type Output = io::Result; fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { 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 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 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 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 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 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 io::Read for Contents<'_, T> { fn read(&mut self, buf: &mut [u8]) -> io::Result { 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 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 tokio::io::AsyncWrite for File<'_, S> { fn poll_write(self: Pin<&mut Self>, cx: &mut Context, data: &[u8]) -> Poll> { 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 for EncoderOutput<'a, T> { +impl std::convert::AsMut 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 for EncoderOutput<'a, T> { } } -impl<'a, T> std::convert::From for EncoderOutput<'a, T> { +impl std::convert::From 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 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 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 tokio::io::AsyncWrite for FileImpl<'_, S> { fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll> { 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 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 io::Write for File<'_, S> { fn write(&mut self, data: &[u8]) -> io::Result { 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