summaryrefslogtreecommitdiff
path: root/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.rs')
-rw-r--r--src/ast.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ast.rs b/src/ast.rs
index bc3547d..4e1d33b 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -803,15 +803,16 @@ fn step(
}
let step = step.unwrap();
- let m = bindings.find(&step);
- if m.is_none() {
- eprintln!("Could not finding binding for: {}", text);
- return (
- error_msg(&format!("Could not find binding for: {}", text)),
- defkind,
- );
- }
- let m = m.unwrap();
+ let m = match bindings.find(&step) {
+ Ok(m) => m,
+ Err(e) => {
+ eprintln!("Could not select binding: {:?}", e);
+ return (
+ error_msg(&format!("Could not select binding for: {}", text)),
+ defkind,
+ );
+ }
+ };
let mut inlines = Vec::new();