Clippy fixes after Rust update

This commit is contained in:
Thomas Eizinger 2021-05-04 11:29:59 +10:00
parent 99fd1c84d9
commit 6c238b1617
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
4 changed files with 6 additions and 12 deletions

View File

@ -257,7 +257,7 @@ async fn register_tor_services(
}
})
})
.filter_map(|details| details)
.flatten()
.collect::<Vec<_>>();
let key = seed.derive_torv3_key();

View File

@ -274,11 +274,11 @@ impl State2 {
// recover(encsign(a, S_b, d), sign(a, d), S_b) = s_b where d is a digest, (a,
// A) is alice's keypair and (s_b, S_b) is bob's keypair.
let tx_refund_encsig = self.a.encsign(self.S_b_bitcoin, tx_refund.digest());
let tx_cancel_sig = self.a.sign(tx_cancel.digest());
Message3 {
tx_refund_encsig,
tx_cancel_sig,
tx_refund_encsig,
}
}

View File

@ -139,7 +139,7 @@ impl State0 {
let valid = CROSS_CURVE_PROOF_SYSTEM.verify(
&msg.dleq_proof_s_a,
(
msg.S_a_bitcoin.clone().into(),
msg.S_a_bitcoin.into(),
msg.S_a_monero
.point
.decompress()

View File

@ -516,11 +516,7 @@ impl Header {
pub fn username_bytes(&self) -> Option<&[u8]> {
if let Some(ustar) = self.as_ustar() {
Some(ustar.username_bytes())
} else if let Some(gnu) = self.as_gnu() {
Some(gnu.username_bytes())
} else {
None
}
} else { self.as_gnu().map(|gnu| gnu.username_bytes()) }
}
/// Sets the username inside this header.
@ -558,10 +554,8 @@ impl Header {
pub fn groupname_bytes(&self) -> Option<&[u8]> {
if let Some(ustar) = self.as_ustar() {
Some(ustar.groupname_bytes())
} else if let Some(gnu) = self.as_gnu() {
Some(gnu.groupname_bytes())
} else {
None
self.as_gnu().map(|gnu| gnu.groupname_bytes())
}
}