Skip to content

Commit

Permalink
Fix needless_lifetimes Clippy lint (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Oct 27, 2024
1 parent a3ef399 commit 5c7892d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.78.0
toolchain: 1.82.0
components: clippy
- run: cargo clippy --all -- -D warnings

Expand Down
8 changes: 4 additions & 4 deletions chacha20/src/backends/soft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ use cipher::{
pub(crate) struct Backend<'a, R: Rounds, V: Variant>(pub(crate) &'a mut ChaChaCore<R, V>);

#[cfg(feature = "cipher")]
impl<'a, R: Rounds, V: Variant> BlockSizeUser for Backend<'a, R, V> {
impl<R: Rounds, V: Variant> BlockSizeUser for Backend<'_, R, V> {
type BlockSize = U64;
}

#[cfg(feature = "cipher")]
impl<'a, R: Rounds, V: Variant> ParBlocksSizeUser for Backend<'a, R, V> {
impl<R: Rounds, V: Variant> ParBlocksSizeUser for Backend<'_, R, V> {
type ParBlocksSize = U1;
}

#[cfg(feature = "cipher")]
impl<'a, R: Rounds, V: Variant> StreamCipherBackend for Backend<'a, R, V> {
impl<R: Rounds, V: Variant> StreamCipherBackend for Backend<'_, R, V> {
#[inline(always)]
fn gen_ks_block(&mut self, block: &mut Block) {
let res = run_rounds::<R>(&self.0.state);
Expand All @@ -37,7 +37,7 @@ impl<'a, R: Rounds, V: Variant> StreamCipherBackend for Backend<'a, R, V> {
}

#[cfg(feature = "rng")]
impl<'a, R: Rounds, V: Variant> Backend<'a, R, V> {
impl<R: Rounds, V: Variant> Backend<'_, R, V> {
#[inline(always)]
pub(crate) fn gen_ks_blocks(&mut self, buffer: &mut [u32; 64]) {
for i in 0..4 {
Expand Down
6 changes: 3 additions & 3 deletions hc-256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ impl ZeroizeOnDrop for Hc256Core {}

struct Backend<'a>(&'a mut Hc256Core);

impl<'a> BlockSizeUser for Backend<'a> {
impl BlockSizeUser for Backend<'_> {
type BlockSize = <Hc256Core as BlockSizeUser>::BlockSize;
}

impl<'a> ParBlocksSizeUser for Backend<'a> {
impl ParBlocksSizeUser for Backend<'_> {
type ParBlocksSize = U1;
}

impl<'a> StreamCipherBackend for Backend<'a> {
impl StreamCipherBackend for Backend<'_> {
#[inline(always)]
fn gen_ks_block(&mut self, block: &mut Block<Self>) {
block.copy_from_slice(&self.0.gen_word().to_le_bytes());
Expand Down
6 changes: 3 additions & 3 deletions rabbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ impl StreamCipherCore for RabbitCore {

struct Backend<'a>(&'a mut State);

impl<'a> BlockSizeUser for Backend<'a> {
impl BlockSizeUser for Backend<'_> {
type BlockSize = BlockSize;
}

impl<'a> ParBlocksSizeUser for Backend<'a> {
impl ParBlocksSizeUser for Backend<'_> {
type ParBlocksSize = U1;
}

impl<'a> StreamCipherBackend for Backend<'a> {
impl StreamCipherBackend for Backend<'_> {
#[inline(always)]
fn gen_ks_block(&mut self, block: &mut Block<Self>) {
block.copy_from_slice(&self.0.next_block());
Expand Down
6 changes: 3 additions & 3 deletions rc4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ impl<KeySize> ZeroizeOnDrop for Rc4Core<KeySize> where KeySize: ArraySize {}

struct Backend<'a>(&'a mut Rc4State);

impl<'a> BlockSizeUser for Backend<'a> {
impl BlockSizeUser for Backend<'_> {
type BlockSize = BlockSize;
}

impl<'a> ParBlocksSizeUser for Backend<'a> {
impl ParBlocksSizeUser for Backend<'_> {
type ParBlocksSize = consts::U1;
}

impl<'a> StreamCipherBackend for Backend<'a> {
impl StreamCipherBackend for Backend<'_> {
#[inline(always)]
fn gen_ks_block(&mut self, block: &mut Block<Self>) {
block[0] = self.0.prga();
Expand Down
6 changes: 3 additions & 3 deletions salsa20/src/backends/soft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ use cipher::{

pub(crate) struct Backend<'a, R: Unsigned>(pub(crate) &'a mut SalsaCore<R>);

impl<'a, R: Unsigned> BlockSizeUser for Backend<'a, R> {
impl<R: Unsigned> BlockSizeUser for Backend<'_, R> {
type BlockSize = U64;
}

impl<'a, R: Unsigned> ParBlocksSizeUser for Backend<'a, R> {
impl<R: Unsigned> ParBlocksSizeUser for Backend<'_, R> {
type ParBlocksSize = U1;
}

impl<'a, R: Unsigned> StreamCipherBackend for Backend<'a, R> {
impl<R: Unsigned> StreamCipherBackend for Backend<'_, R> {
#[inline(always)]
fn gen_ks_block(&mut self, block: &mut Block<Self>) {
let res = run_rounds::<R>(&self.0.state);
Expand Down

0 comments on commit 5c7892d

Please sign in to comment.