Skip to content

Commit

Permalink
Make rustc 1.75.0 linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword-Smith committed Jan 3, 2024
1 parent 5f52afc commit 6018108
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/models/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ pub struct PeerStanding {
impl PeerStanding {
/// Sanction peer and return latest standing score
pub fn sanction(&mut self, reason: PeerSanctionReason) -> i32 {
self.standing = self
.standing
.saturating_sub(reason.to_severity().try_into().unwrap());
self.standing = self.standing.saturating_sub(reason.to_severity().into());
self.latest_sanction = Some(reason);
self.timestamp_of_latest_sanction = Some(SystemTime::now());
self.standing
Expand Down
2 changes: 1 addition & 1 deletion src/models/state/wallet/address/generation_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct ReceivingAddress {
}

fn pubscript_input_is_marked(pubscript_input: &[BFieldElement]) -> bool {
matches!(pubscript_input.get(0), Some(&GENERATION_FLAG))
matches!(pubscript_input.first(), Some(&GENERATION_FLAG))
}

fn derive_receiver_id(seed: Digest) -> BFieldElement {
Expand Down
2 changes: 1 addition & 1 deletion src/models/state/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl WalletSecret {
self.secret_seed.encode(),
vec![
generation_address::GENERATION_FLAG,
BFieldElement::new(counter.try_into().unwrap()),
BFieldElement::new(counter.into()),
],
]
.concat(),
Expand Down
5 changes: 2 additions & 3 deletions src/util_types/mutator_set/ms_membership_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,9 +1285,8 @@ mod ms_proof_tests {
archival_mutator_set.revert_remove(&removal_record);

// assert valid proofs
for (_, (_, mp)) in tracked_items_and_membership_proofs
.iter_mut()
.enumerate()
for (_, mp) in
tracked_items_and_membership_proofs.iter_mut()
{
mp.revert_update_from_remove(&removal_record)
.expect("Could not revert remove.");
Expand Down
2 changes: 1 addition & 1 deletion src/util_types/mutator_set/mutator_set_accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ mod ms_accumulator_tests {
let original_membership_proofs_sequential =
membership_proofs_sequential.clone();
let mut update_by_remove_return_values: Vec<bool> = vec![];
for (_i, mp) in membership_proofs_sequential.iter_mut().enumerate() {
for mp in membership_proofs_sequential.iter_mut() {
let update_res_seq = mp.update_from_remove(&removal_record);
assert!(update_res_seq.is_ok());
update_by_remove_return_values.push(update_res_seq.unwrap());
Expand Down

0 comments on commit 6018108

Please sign in to comment.