From 831b0267de342d39c1743f8f9c87b428407c317b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 21 Apr 2022 12:07:46 +1000 Subject: [PATCH] Use contains() instead of manual range We no longer support Rust 1.29, we can use `contains` for ranges instead of doing so manually. --- src/blockdata/opcodes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockdata/opcodes.rs b/src/blockdata/opcodes.rs index 41b4796d..6d1e2103 100644 --- a/src/blockdata/opcodes.rs +++ b/src/blockdata/opcodes.rs @@ -651,7 +651,7 @@ impl fmt::Debug for All { all::OP_CHECKMULTISIGVERIFY => write!(f, "CHECKMULTISIGVERIFY"), all::OP_CLTV => write!(f, "CLTV"), 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_CHECKSIGADD => write!(f, "CHECKSIGADD"), All {code: x} => write!(f, "RETURN_{}", x),