Skip to content

Commit

Permalink
chore: resolve clippy complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Jun 14, 2024
1 parent 850d961 commit 9da47f4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
11 changes: 4 additions & 7 deletions sn_auditor/src/dag_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,10 @@ impl SpendDagDb {
let mut beta_tracking = self.beta_tracking.write().await;
for (hash, p) in new_participants {
let unkown_str = format!("unknown participant: {hash:?}");
let mut payments = if let Some(prev_payments) =
beta_tracking.forwarded_payments.remove(&unkown_str)
{
prev_payments
} else {
BTreeSet::new()
};
let mut payments = beta_tracking
.forwarded_payments
.remove(&unkown_str)
.unwrap_or_default();

if let Some(existing) = beta_tracking
.forwarded_payments
Expand Down
3 changes: 2 additions & 1 deletion sn_networking/src/log_markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use strum::Display;
#[derive(Debug, Clone, Display, Copy)]
pub enum Marker<'a> {
/// Close records held (Used in VDash)
CloseRecordsLen(&'a usize),
#[allow(dead_code)]
CloseRecordsLen(usize),
/// Store cost
StoreCost {
/// Cost
Expand Down
2 changes: 1 addition & 1 deletion sn_networking/src/record_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ impl NodeRecordStore {
})
.count();

Marker::CloseRecordsLen(&relevant_records_len).log();
Marker::CloseRecordsLen(relevant_records_len).log();
relevant_records_len
}

Expand Down
1 change: 0 additions & 1 deletion sn_transfers/src/cashnotes/nano.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ impl Display for NanoTokens {
#[cfg(test)]
mod tests {
use super::*;
use std::u64;

#[test]
fn from_str() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion sn_transfers/src/cashnotes/spend_reason.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl SpendReason {
}
}

const MAX_CIPHER_SIZE: usize = std::u8::MAX as usize;
const MAX_CIPHER_SIZE: usize = u8::MAX as usize;
const DERIVATION_INDEX_SIZE: usize = 32;
const HASH_SIZE: usize = 32;
const CHECK_SUM_SIZE: usize = 8;
Expand Down
12 changes: 4 additions & 8 deletions sn_transfers/src/wallet/hot_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ impl HotWallet {
std::fs::create_dir_all(&wallet_dir)?;
// Create the new wallet for this key
store_new_keypair(&wallet_dir, &key)?;
let unconfirmed_spend_requests = match get_unconfirmed_spend_requests(&wallet_dir)? {
Some(unconfirmed_spend_requests) => unconfirmed_spend_requests,
None => Default::default(),
};
let unconfirmed_spend_requests =
(get_unconfirmed_spend_requests(&wallet_dir)?).unwrap_or_default();
let watchonly_wallet = WatchOnlyWallet::load_from(&wallet_dir, key.main_pubkey())?;

Ok(Self {
Expand Down Expand Up @@ -667,10 +665,8 @@ impl HotWallet {
}
}
};
let unconfirmed_spend_requests = match get_unconfirmed_spend_requests(wallet_dir)? {
Some(unconfirmed_spend_requests) => unconfirmed_spend_requests,
None => Default::default(),
};
let unconfirmed_spend_requests =
(get_unconfirmed_spend_requests(wallet_dir)?).unwrap_or_default();
let watchonly_wallet = WatchOnlyWallet::load_from(wallet_dir, key.main_pubkey())?;

Ok(Self {
Expand Down

0 comments on commit 9da47f4

Please sign in to comment.