Skip to content

Commit

Permalink
Fix feature-dependent clippy complaints.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Dec 15, 2024
1 parent 8c6e3ef commit c7b0e01
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions zcash_keys/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ impl Display for UnifiedKeyError {
UnifiedKeyError::Transparent(e) => {
write!(_f, "Transparent key derivation error: {}", e)
}
#[cfg(not(any(feature = "orchard", feature = "transparent-inputs")))]
other => {
unreachable!("Unhandled UnifiedKeyError variant {:?}", other)
}
}
}
}
Expand Down Expand Up @@ -608,26 +604,26 @@ impl UnifiedAddressRequest {
/// Returns `None` if the request would result in the generation of an address without any
/// receivers.
pub fn new(
has_orchard: bool,
has_sapling: bool,
has_p2pkh: bool,
_has_orchard: bool,
_has_sapling: bool,
_has_p2pkh: bool,
expiry_height: Option<BlockHeight>,
expiry_time: Option<u64>,
) -> Option<Self> {
#[cfg(not(feature = "orchard"))]
let has_orchard = false;
let _has_orchard = false;
#[cfg(not(feature = "sapling"))]
let has_sapling = false;
let _has_sapling = false;
#[cfg(not(feature = "transparent-inputs"))]
let has_p2pkh = false;
let _has_p2pkh = false;

if !(has_sapling || has_orchard || has_p2pkh) {
if !(_has_sapling || _has_orchard || _has_p2pkh) {
None
} else {
Some(Self {
has_orchard,
has_sapling,
has_p2pkh,
has_orchard: _has_orchard,
has_sapling: _has_sapling,
has_p2pkh: _has_p2pkh,
expiry_height,
expiry_time,
})
Expand Down

0 comments on commit c7b0e01

Please sign in to comment.