Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit ce57ee6

Browse files
committed
fix clippy
1 parent 0a78282 commit ce57ee6

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

ledger/src/shred/legacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl ShredDataTrait for ShredData {
183183
}
184184
self.payload
185185
.get(SHRED_DATA_OFFSET..size)
186-
.ok_or_else(|| Error::InvalidPayloadSize(self.payload.len()))
186+
.ok_or(Error::InvalidPayloadSize(self.payload.len()))
187187
}
188188

189189
// Only for tests.

ledger/src/shred/merkle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl ShredData {
7575
+ SIZE_OF_MERKLE_ROOT
7676
+ usize::from(proof_size) * SIZE_OF_MERKLE_PROOF_ENTRY,
7777
)
78-
.ok_or_else(|| Error::InvalidProofSize(proof_size))
78+
.ok_or(Error::InvalidProofSize(proof_size))
7979
}
8080
}
8181

@@ -97,7 +97,7 @@ impl ShredCode {
9797
+ SIZE_OF_MERKLE_ROOT
9898
+ SIZE_OF_MERKLE_PROOF_ENTRY * usize::from(proof_size),
9999
)
100-
.ok_or_else(|| Error::InvalidProofSize(proof_size))
100+
.ok_or(Error::InvalidProofSize(proof_size))
101101
}
102102
}
103103

@@ -274,7 +274,7 @@ impl ShredDataTrait for ShredData {
274274
}
275275
self.payload
276276
.get(SHRED_DATA_OFFSET..size)
277-
.ok_or_else(|| Error::InvalidPayloadSize(self.payload.len()))
277+
.ok_or(Error::InvalidPayloadSize(self.payload.len()))
278278
}
279279

280280
// Only for tests.

ledger/src/shred/shred_data.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ impl ShredData {
8484
// Possibly zero pads bytes stored in blockstore.
8585
pub(crate) fn resize_stored_shred(shred: Vec<u8>) -> Result<Vec<u8>, Error> {
8686
match Shred::shred_variant_from_payload(&shred)? {
87-
ShredVariant::LegacyCode | ShredVariant::MerkleCode(_) => {
88-
return Err(Error::InvalidShredType);
89-
}
87+
ShredVariant::LegacyCode | ShredVariant::MerkleCode(_) => Err(Error::InvalidShredType),
9088
ShredVariant::MerkleData(_) => {
9189
if shred.len() != merkle::ShredData::SIZE_OF_PAYLOAD {
9290
return Err(Error::InvalidPayloadSize(shred.len()));

0 commit comments

Comments
 (0)