diff options
Diffstat (limited to 'src/makefile/inference_rules.rs')
-rw-r--r-- | src/makefile/inference_rules.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/makefile/inference_rules.rs b/src/makefile/inference_rules.rs index 368d72b..f8bdd65 100644 --- a/src/makefile/inference_rules.rs +++ b/src/makefile/inference_rules.rs @@ -1,6 +1,6 @@ use std::fmt; -use eyre::{eyre, Result}; +use eyre::{eyre, OptionExt, Result}; use regex::Captures; use super::command_line::CommandLine; @@ -49,7 +49,10 @@ impl InferenceRule { let capture = self .first_match(target_name)? .ok_or_else(|| eyre!("asked non-matching inference rule for prerequisites"))?; - let percent_expansion = capture.get(1).expect("should've matched the %").as_str(); + let percent_expansion = capture + .get(1) + .ok_or_eyre("should've matched the %")? + .as_str(); Ok(self .prerequisites .iter() |