From 55ab2f34a7ca9ec9e1356fcfa366ef212f242e1e Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 4 Feb 2025 16:45:47 +0000 Subject: [PATCH] Remove manual implementation of ok New rustc nightly gives error: manual implementation of `ok`. Remove it. --- bitcoin/src/blockdata/script/instruction.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bitcoin/src/blockdata/script/instruction.rs b/bitcoin/src/blockdata/script/instruction.rs index 8bf30cdd7..410f6d521 100644 --- a/bitcoin/src/blockdata/script/instruction.rs +++ b/bitcoin/src/blockdata/script/instruction.rs @@ -47,12 +47,7 @@ impl Instruction<'_> { _ => None, } } - Instruction::PushBytes(bytes) => { - match super::read_scriptint_non_minimal(bytes.as_bytes()) { - Ok(v) => Some(v), - _ => None, - } - } + Instruction::PushBytes(bytes) => super::read_scriptint_non_minimal(bytes.as_bytes()).ok(), } } @@ -78,10 +73,7 @@ impl Instruction<'_> { _ => None, } } - Instruction::PushBytes(bytes) => match bytes.read_scriptint() { - Ok(v) => Some(v), - _ => None, - }, + Instruction::PushBytes(bytes) => bytes.read_scriptint().ok(), } } }