Use contains() instead of manual range

We no longer support Rust 1.29, we can use `contains` for ranges instead
of doing so manually.
This commit is contained in:
Tobin C. Harding 2022-04-21 12:07:46 +10:00
parent 6410095687
commit 831b0267de
1 changed files with 1 additions and 1 deletions

View File

@ -651,7 +651,7 @@ impl fmt::Debug for All {
all::OP_CHECKMULTISIGVERIFY => write!(f, "CHECKMULTISIGVERIFY"), all::OP_CHECKMULTISIGVERIFY => write!(f, "CHECKMULTISIGVERIFY"),
all::OP_CLTV => write!(f, "CLTV"), all::OP_CLTV => write!(f, "CLTV"),
all::OP_CSV => write!(f, "CSV"), all::OP_CSV => write!(f, "CSV"),
All {code: x} if x >= all::OP_NOP1.code && x <= all::OP_NOP10.code => write!(f, "NOP{}", x - all::OP_NOP1.code + 1), All {code: x} if (all::OP_NOP1.code..=all::OP_NOP10.code).contains(&x) => write!(f, "NOP{}", x - all::OP_NOP1.code + 1),
all::OP_INVALIDOPCODE => write!(f, "INVALIDOPCODE"), all::OP_INVALIDOPCODE => write!(f, "INVALIDOPCODE"),
all::OP_CHECKSIGADD => write!(f, "CHECKSIGADD"), all::OP_CHECKSIGADD => write!(f, "CHECKSIGADD"),
All {code: x} => write!(f, "RETURN_{}", x), All {code: x} => write!(f, "RETURN_{}", x),