zcash_address: Fix clippy lint by using matches! macro

This commit is contained in:
Jack Grigg 2021-07-12 21:17:25 +01:00
parent 8527dcbc32
commit b875f6c34b
1 changed files with 3 additions and 7 deletions

View File

@ -101,13 +101,9 @@ impl From<Typecode> for u8 {
impl Typecode {
fn is_transparent(&self) -> bool {
match self {
Typecode::P2pkh | Typecode::P2sh => true,
// Unknown typecodes are treated as not transparent for the purpose of
// disallowing only-transparent UAs, which can be represented with existing
// address encodings.
_ => false,
}
// Unknown typecodes are treated as not transparent for the purpose of disallowing
// only-transparent UAs, which can be represented with existing address encodings.
matches!(self, Typecode::P2pkh | Typecode::P2sh)
}
}