From a82a2105fd1b1a99bddb835ed1d9dbf2e2a5c56f Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 22 Dec 2023 16:44:34 -0700 Subject: Use unwrap_or_else to avoid running error path code when there isn't an error --- rust/src/llil/operation.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rust/src/llil/operation.rs') diff --git a/rust/src/llil/operation.rs b/rust/src/llil/operation.rs index 4daa7cb2..f90fafd8 100644 --- a/rust/src/llil/operation.rs +++ b/rust/src/llil/operation.rs @@ -124,7 +124,7 @@ where .arch() .register_from_id(raw_id) .map(Register::ArchReg) - .unwrap_or({ + .unwrap_or_else(|| { error!( "got garbage register from LLIL_SET_REG @ 0x{:x}", self.op.address @@ -163,7 +163,7 @@ where .arch() .register_from_id(raw_id) .map(Register::ArchReg) - .unwrap_or({ + .unwrap_or_else(|| { error!( "got garbage register from LLIL_SET_REG_SPLIT @ 0x{:x}", self.op.address @@ -184,7 +184,7 @@ where .arch() .register_from_id(raw_id) .map(Register::ArchReg) - .unwrap_or({ + .unwrap_or_else(|| { error!( "got garbage register from LLIL_SET_REG_SPLIT @ 0x{:x}", self.op.address @@ -277,7 +277,7 @@ where .arch() .register_from_id(raw_id) .map(Register::ArchReg) - .unwrap_or({ + .unwrap_or_else(|| { error!( "got garbage register from LLIL_REG @ 0x{:x}", self.op.address -- cgit v1.3.1