Skip to content

Commit c504957

Browse files
committed
Use contains() instead of manual range
We no longer support Rust 1.29, we can use `contains` for ranges instead of doing so manually.
1 parent a3360b6 commit c504957

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blockdata/opcodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ impl fmt::Debug for All {
651651
all::OP_CHECKMULTISIGVERIFY => write!(f, "CHECKMULTISIGVERIFY"),
652652
all::OP_CLTV => write!(f, "CLTV"),
653653
all::OP_CSV => write!(f, "CSV"),
654-
All {code: x} if x >= all::OP_NOP1.code && x <= all::OP_NOP10.code => write!(f, "NOP{}", x - all::OP_NOP1.code + 1),
654+
All {code: x} if (all::OP_NOP1.code..=all::OP_NOP10.code).contains(&x) => write!(f, "NOP{}", x - all::OP_NOP1.code + 1),
655655
all::OP_INVALIDOPCODE => write!(f, "INVALIDOPCODE"),
656656
all::OP_CHECKSIGADD => write!(f, "CHECKSIGADD"),
657657
All {code: x} => write!(f, "RETURN_{}", x),

0 commit comments

Comments
 (0)