From a769b4c8d555360fab513259555ab534d3281505 Mon Sep 17 00:00:00 2001 From: Jiri Date: Fri, 12 Apr 2024 10:31:25 +0200 Subject: [PATCH] Clippy fix --- src/crypto/ethereum.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/ethereum.rs b/src/crypto/ethereum.rs index 0e486df..eb4e409 100644 --- a/src/crypto/ethereum.rs +++ b/src/crypto/ethereum.rs @@ -81,7 +81,8 @@ fn parse_eth_signature(signature: &str) -> Result<(u8, Vec), StdError> { // extract the recovery code let mut recovery_code = unpacked_signature .pop() - .ok_or(signature_error(&"Wrong recovery code"))?; + .ok_or_else(|| signature_error(&"Wrong recovery code"))?; + if recovery_code >= 27u8 { recovery_code -= 27u8; }