Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcaseria committed Feb 19, 2025
1 parent 92d3b58 commit 67e33e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions crates/cdk/src/wallet/proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ impl Wallet {
let mut selected_proofs = selected_proofs.into_iter().collect::<Vec<_>>();
let total_amount = selected_proofs.total_amount()?;
if total_amount != amount && selected_proofs.len() > 1 {
selected_proofs.sort_by(|a, b| a.cmp(b).reverse());
selected_proofs = Self::select_least_amount_over(selected_proofs, amount)?;
}

Expand All @@ -315,8 +316,6 @@ impl Wallet {
return Ok(proofs);
}

let mut proofs = proofs;
proofs.sort_by(|a, b| a.cmp(b).reverse());
for i in 1..proofs.len() {
let (left, right) = proofs.split_at(i);
let left = left.to_vec();
Expand Down
4 changes: 1 addition & 3 deletions crates/cdk/src/wallet/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ impl Wallet {

// Include token memo
let send_memo = send.options.memo.or(memo);
let memo = send_memo
.map(|m| if m.include_memo { Some(m.memo) } else { None })
.flatten();
let memo = send_memo.and_then(|m| if m.include_memo { Some(m.memo) } else { None });

// Create and return token
Ok(Token::new(
Expand Down

0 comments on commit 67e33e7

Please sign in to comment.