cashu-sdk chore: clippy

This commit is contained in:
thesimplekid
2023-09-10 21:05:47 +01:00
parent 57b6607f9a
commit c6f38f3cc8
3 changed files with 7 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ impl Mint {
/// Return a list of all supported keysets
pub fn keysets(&self) -> nut02::Response {
let mut keysets: HashSet<_> = self.inactive_keysets.keys().cloned().collect();
keysets.insert(self.active_keyset.id.clone());
keysets.insert(self.active_keyset.id);
nut02::Response { keysets }
}
@@ -84,7 +84,7 @@ impl Mint {
) {
// Add current set to inactive keysets
self.inactive_keysets
.insert(self.active_keyset.id.clone(), self.active_keyset.clone());
.insert(self.active_keyset.id, self.active_keyset.clone());
self.active_keyset = KeySet::generate(secret, derivation_path, max_order);
}
@@ -107,7 +107,7 @@ impl Mint {
fn blind_sign(&self, blinded_message: &BlindedMessage) -> Result<BlindedSignature, Error> {
let BlindedMessage { amount, b } = blinded_message;
let Some(key_pair) = self.active_keyset.keys.0.get(&amount) else {
let Some(key_pair) = self.active_keyset.keys.0.get(amount) else {
// No key for amount
return Err(Error::AmountKey);
};
@@ -117,7 +117,7 @@ impl Mint {
Ok(BlindedSignature {
amount: *amount,
c: c.into(),
id: self.active_keyset.id.clone(),
id: self.active_keyset.id,
})
}

View File

@@ -316,7 +316,7 @@ impl Wallet {
let unblinded_sig = unblind_message(blinded_c, rs[i].clone().into(), a).unwrap();
let proof = Proof {
id: Some(promise.id.clone()),
id: Some(promise.id),
amount: promise.amount,
secret: secrets[i].clone(),
c: unblinded_sig,

View File

@@ -41,14 +41,14 @@ impl SplitRequest {
pub struct SplitResponse {
/// Promises to keep
#[deprecated(
since = "0.5.0",
since = "0.3.0",
note = "mint only response with one list of all promises"
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub fst: Option<Vec<BlindedSignature>>,
/// Promises to send
#[deprecated(
since = "0.5.0",
since = "0.3.0",
note = "mint only response with one list of all promises"
)]
#[serde(skip_serializing_if = "Option::is_none")]