fmt/clippy

This commit is contained in:
Luke Parker
2022-09-17 04:35:08 -04:00
parent fd6c58805f
commit 65c20638ce
11 changed files with 15 additions and 24 deletions

View File

@@ -133,9 +133,7 @@ impl ToString for Address {
if let AddressType::Featured(subaddress, payment_id, guaranteed) = self.meta.kind {
// Technically should be a VarInt, yet we don't have enough features it's needed
data.push(
(if subaddress { 1 } else { 0 }) +
((if payment_id.is_some() { 1 } else { 0 }) << 1) +
((if guaranteed { 1 } else { 0 }) << 2),
u8::from(subaddress) + (u8::from(payment_id.is_some()) << 1) + (u8::from(guaranteed) << 2),
);
}
if let Some(id) = self.meta.kind.payment_id() {

View File

@@ -223,7 +223,7 @@ impl SignableTransaction {
if change && change_address.is_none() {
Err(TransactionError::NoChange)?;
}
let outputs = payments.len() + (if change { 1 } else { 0 });
let outputs = payments.len() + usize::from(change);
// Calculate the extra length
let extra = Extra::fee_weight(outputs, data.as_ref());