summaryrefslogtreecommitdiff
path: root/rust/src/architecture.rs
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2023-12-22 16:44:34 -0700
committerRusty Wagner <rusty.wagner@gmail.com>2024-01-04 11:02:14 -0700
commita82a2105fd1b1a99bddb835ed1d9dbf2e2a5c56f (patch)
treecbf61cb01a6d2b1102a2465132d2d2df22ba3900 /rust/src/architecture.rs
parent80b07dfa158bb093cc93e602363655b62ae595f8 (diff)
Use unwrap_or_else to avoid running error path code when there isn't an error
Diffstat (limited to 'rust/src/architecture.rs')
-rw-r--r--rust/src/architecture.rs2
1 files changed, 1 insertions, 1 deletions
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()))
}
}