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/architecture.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/src/architecture.rs') diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index edc16209..9b5af6ee 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -1472,7 +1472,7 @@ impl Architecture for CoreArchitecture { if res { Ok(result.get_data().to_vec()) } else { - Err(error.unwrap_or("Assemble failed".into())) + Err(error.unwrap_or_else(|| "Assemble failed".into())) } } -- cgit v1.3.1