From a616f90f998097a7fc48b980c4c6d4dc2006e5c7 Mon Sep 17 00:00:00 2001 From: nemo Date: Mon, 6 Jan 2025 11:50:23 -0500 Subject: [PATCH] fix: update rust-toolchain fix: all required clippy updates --- fr32/src/padding.rs | 2 +- rust-toolchain | 2 +- storage-proofs-core/benches/blake2s.rs | 2 +- storage-proofs-core/benches/sha256.rs | 2 +- storage-proofs-core/benches/xor.rs | 2 +- storage-proofs-core/src/data.rs | 10 +++++----- storage-proofs-porep/src/stacked/vanilla/params.rs | 2 +- .../src/stacked/vanilla/proof_scheme.rs | 4 ++-- storage-proofs-porep/src/stacked/vanilla/utils.rs | 2 +- storage-proofs-update/src/compound.rs | 2 +- storage-proofs-update/src/poseidon/compound.rs | 2 +- storage-proofs-update/src/poseidon/vanilla.rs | 2 +- storage-proofs-update/src/vanilla.rs | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fr32/src/padding.rs b/fr32/src/padding.rs index 861ec53f8b..8cc7c546f4 100644 --- a/fr32/src/padding.rs +++ b/fr32/src/padding.rs @@ -539,7 +539,7 @@ fn clear_right_bits(byte: &mut u8, offset: usize) { *(byte) &= !((1 << offset) - 1) } -/** Padding process. +/* Padding process. Read a `source` of raw byte-aligned data, pad it in a bit stream and write a byte-aligned version of it in the `target`. The `target` needs diff --git a/rust-toolchain b/rust-toolchain index dbd41264aa..6b4de0a42b 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.81.0 +1.83.0 diff --git a/storage-proofs-core/benches/blake2s.rs b/storage-proofs-core/benches/blake2s.rs index 9b4900060d..49c0cea62b 100644 --- a/storage-proofs-core/benches/blake2s.rs +++ b/storage-proofs-core/benches/blake2s.rs @@ -16,7 +16,7 @@ struct Blake2sExample<'a> { data: &'a [Option], } -impl<'a> Circuit for Blake2sExample<'a> { +impl Circuit for Blake2sExample<'_> { fn synthesize>(self, cs: &mut CS) -> Result<(), SynthesisError> { let data: Vec = self .data diff --git a/storage-proofs-core/benches/sha256.rs b/storage-proofs-core/benches/sha256.rs index e312b39b4c..9c796b3c81 100644 --- a/storage-proofs-core/benches/sha256.rs +++ b/storage-proofs-core/benches/sha256.rs @@ -16,7 +16,7 @@ struct Sha256Example<'a> { data: &'a [Option], } -impl<'a> Circuit for Sha256Example<'a> { +impl Circuit for Sha256Example<'_> { fn synthesize>(self, cs: &mut CS) -> Result<(), SynthesisError> { let data: Vec = self .data diff --git a/storage-proofs-core/benches/xor.rs b/storage-proofs-core/benches/xor.rs index 0c2d28c5b9..1dafd8dbec 100644 --- a/storage-proofs-core/benches/xor.rs +++ b/storage-proofs-core/benches/xor.rs @@ -14,7 +14,7 @@ struct XorExample<'a> { data: &'a [Option], } -impl<'a> Circuit for XorExample<'a> { +impl Circuit for XorExample<'_> { fn synthesize>(self, cs: &mut CS) -> Result<(), SynthesisError> { let key: Vec = self .key diff --git a/storage-proofs-core/src/data.rs b/storage-proofs-core/src/data.rs index 47941ae38a..5ee73bb359 100644 --- a/storage-proofs-core/src/data.rs +++ b/storage-proofs-core/src/data.rs @@ -21,7 +21,7 @@ enum RawData<'a> { Mmap(MmapMut), } -impl<'a> Deref for RawData<'a> { +impl Deref for RawData<'_> { type Target = [u8]; fn deref(&self) -> &Self::Target { @@ -32,7 +32,7 @@ impl<'a> Deref for RawData<'a> { } } -impl<'a> DerefMut for RawData<'a> { +impl DerefMut for RawData<'_> { fn deref_mut(&mut self) -> &mut Self::Target { match self { RawData::Slice(ref mut raw) => raw, @@ -52,7 +52,7 @@ impl<'a> From<&'a mut [u8]> for Data<'a> { } } -impl<'a> From<(MmapMut, PathBuf)> for Data<'a> { +impl From<(MmapMut, PathBuf)> for Data<'_> { fn from(raw: (MmapMut, PathBuf)) -> Self { let len = raw.0.len(); Data { @@ -63,7 +63,7 @@ impl<'a> From<(MmapMut, PathBuf)> for Data<'a> { } } -impl<'a> AsRef<[u8]> for Data<'a> { +impl AsRef<[u8]> for Data<'_> { fn as_ref(&self) -> &[u8] { match self.raw { Some(ref raw) => raw, @@ -72,7 +72,7 @@ impl<'a> AsRef<[u8]> for Data<'a> { } } -impl<'a> AsMut<[u8]> for Data<'a> { +impl AsMut<[u8]> for Data<'_> { fn as_mut(&mut self) -> &mut [u8] { match self.raw { Some(ref mut raw) => raw, diff --git a/storage-proofs-porep/src/stacked/vanilla/params.rs b/storage-proofs-porep/src/stacked/vanilla/params.rs index 1fe410c058..d078b5bed5 100644 --- a/storage-proofs-porep/src/stacked/vanilla/params.rs +++ b/storage-proofs-porep/src/stacked/vanilla/params.rs @@ -119,7 +119,7 @@ where } } -impl<'a, Tree> From<&'a PublicParams> for PublicParams +impl From<&PublicParams> for PublicParams where Tree: MerkleTreeTrait, { diff --git a/storage-proofs-porep/src/stacked/vanilla/proof_scheme.rs b/storage-proofs-porep/src/stacked/vanilla/proof_scheme.rs index 258577079c..da5d3d0f53 100644 --- a/storage-proofs-porep/src/stacked/vanilla/proof_scheme.rs +++ b/storage-proofs-porep/src/stacked/vanilla/proof_scheme.rs @@ -13,8 +13,8 @@ use crate::stacked::vanilla::{ proof::StackedDrg, }; -impl<'a, 'c, Tree: 'static + MerkleTreeTrait, G: 'static + Hasher> ProofScheme<'a> - for StackedDrg<'c, Tree, G> +impl ProofScheme<'_> + for StackedDrg<'_, Tree, G> { type PublicParams = PublicParams; type SetupParams = SetupParams; diff --git a/storage-proofs-porep/src/stacked/vanilla/utils.rs b/storage-proofs-porep/src/stacked/vanilla/utils.rs index 26c0834012..b94f680887 100644 --- a/storage-proofs-porep/src/stacked/vanilla/utils.rs +++ b/storage-proofs-porep/src/stacked/vanilla/utils.rs @@ -15,7 +15,7 @@ pub struct UnsafeSlice<'a, T> { len: usize, } -unsafe impl<'a, T> Sync for UnsafeSlice<'a, T> {} +unsafe impl Sync for UnsafeSlice<'_, T> {} impl<'a, T> UnsafeSlice<'a, T> { /// Takes mutable slice, to ensure that `UnsafeSlice` is the only user of this memory, until it gets dropped. diff --git a/storage-proofs-update/src/compound.rs b/storage-proofs-update/src/compound.rs index 23aeaac668..a7e5817e94 100644 --- a/storage-proofs-update/src/compound.rs +++ b/storage-proofs-update/src/compound.rs @@ -31,7 +31,7 @@ where } } -impl<'a, TreeR> CompoundProof<'a, EmptySectorUpdate, EmptySectorUpdateCircuit> +impl CompoundProof<'_, EmptySectorUpdate, EmptySectorUpdateCircuit> for EmptySectorUpdateCompound where TreeR: 'static + MerkleTreeTrait, diff --git a/storage-proofs-update/src/poseidon/compound.rs b/storage-proofs-update/src/poseidon/compound.rs index 2ec850540d..c54f4d61d0 100644 --- a/storage-proofs-update/src/poseidon/compound.rs +++ b/storage-proofs-update/src/poseidon/compound.rs @@ -36,7 +36,7 @@ where } } -impl<'a, TreeR> CompoundProof<'a, EmptySectorUpdate, EmptySectorUpdateCircuit> +impl CompoundProof<'_, EmptySectorUpdate, EmptySectorUpdateCircuit> for EmptySectorUpdateCompound where TreeR: 'static + MerkleTreeTrait, diff --git a/storage-proofs-update/src/poseidon/vanilla.rs b/storage-proofs-update/src/poseidon/vanilla.rs index 6ed573f136..3b31db1d3b 100644 --- a/storage-proofs-update/src/poseidon/vanilla.rs +++ b/storage-proofs-update/src/poseidon/vanilla.rs @@ -97,7 +97,7 @@ where _tree_r: PhantomData, } -impl<'a, TreeR> ProofScheme<'a> for EmptySectorUpdate +impl ProofScheme<'_> for EmptySectorUpdate where TreeR: 'static + MerkleTreeTrait, { diff --git a/storage-proofs-update/src/vanilla.rs b/storage-proofs-update/src/vanilla.rs index 79c82de0b0..a14ccbf0e3 100644 --- a/storage-proofs-update/src/vanilla.rs +++ b/storage-proofs-update/src/vanilla.rs @@ -392,7 +392,7 @@ where _tree_r: PhantomData, } -impl<'a, TreeR> ProofScheme<'a> for EmptySectorUpdate +impl ProofScheme<'_> for EmptySectorUpdate where TreeR: 'static + MerkleTreeTrait, {