From e8055e3bcbef394a2d8e65a9bb919ff89189afd4 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 27 Oct 2023 12:24:01 -0600 Subject: [PATCH] cipher: remove needless lifetimes One of the lifetimes is unused, but we couldn't remove it before because it would be a breaking change. Closes #1336 --- cipher/src/block.rs | 16 ++++++++-------- cipher/src/lib.rs | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cipher/src/block.rs b/cipher/src/block.rs index 7b8c99cf..297d4a1b 100644 --- a/cipher/src/block.rs +++ b/cipher/src/block.rs @@ -135,9 +135,9 @@ pub trait BlockEncrypt: BlockSizeUser + Sized { #[cfg(feature = "block-padding")] #[cfg_attr(docsrs, doc(cfg(feature = "block-padding")))] #[inline] - fn encrypt_padded_inout<'inp, 'out, P: Padding>( + fn encrypt_padded_inout<'out, P: Padding>( &self, - data: InOutBufReserved<'inp, 'out, u8>, + data: InOutBufReserved<'_, 'out, u8>, ) -> Result<&'out [u8], PadError> { let mut buf = data.into_padded_blocks::()?; self.encrypt_blocks_inout(buf.get_blocks()); @@ -251,9 +251,9 @@ pub trait BlockDecrypt: BlockSizeUser { #[cfg(feature = "block-padding")] #[cfg_attr(docsrs, doc(cfg(feature = "block-padding")))] #[inline] - fn decrypt_padded_inout<'inp, 'out, P: Padding>( + fn decrypt_padded_inout<'out, P: Padding>( &self, - data: InOutBuf<'inp, 'out, u8>, + data: InOutBuf<'_, 'out, u8>, ) -> Result<&'out [u8], UnpadError> { let (mut blocks, tail) = data.into_chunks(); if !tail.is_empty() { @@ -380,9 +380,9 @@ pub trait BlockEncryptMut: BlockSizeUser + Sized { #[cfg(feature = "block-padding")] #[cfg_attr(docsrs, doc(cfg(feature = "block-padding")))] #[inline] - fn encrypt_padded_inout_mut<'inp, 'out, P: Padding>( + fn encrypt_padded_inout_mut<'out, P: Padding>( mut self, - data: InOutBufReserved<'inp, 'out, u8>, + data: InOutBufReserved<'_, 'out, u8>, ) -> Result<&'out [u8], PadError> { let mut buf = data.into_padded_blocks::()?; self.encrypt_blocks_inout_mut(buf.get_blocks()); @@ -500,9 +500,9 @@ pub trait BlockDecryptMut: BlockSizeUser + Sized { #[cfg(feature = "block-padding")] #[cfg_attr(docsrs, doc(cfg(feature = "block-padding")))] #[inline] - fn decrypt_padded_inout_mut<'inp, 'out, P: Padding>( + fn decrypt_padded_inout_mut<'out, P: Padding>( mut self, - data: InOutBuf<'inp, 'out, u8>, + data: InOutBuf<'_, 'out, u8>, ) -> Result<&'out [u8], UnpadError> { let (mut blocks, tail) = data.into_chunks(); if !tail.is_empty() { diff --git a/cipher/src/lib.rs b/cipher/src/lib.rs index a8af951b..fc476b62 100644 --- a/cipher/src/lib.rs +++ b/cipher/src/lib.rs @@ -11,8 +11,7 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" )] -#![warn(missing_docs, rust_2018_idioms)] -#![allow(clippy::needless_lifetimes)] +#![warn(missing_docs, rust_2018_idioms, unused_lifetimes)] pub use crypto_common; pub use inout;