diff options
author | Melody Horn <melody@boringcactus.com> | 2024-11-10 16:02:48 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2024-11-10 16:02:48 -0700 |
commit | 7029372c9fada6316852915765cc0d763be3c63c (patch) | |
tree | d649d79de0b83b84637d85595fd6de2cfa38f17c /src/makefile/inference_rules.rs | |
parent | e9080b515d86b9f39e97d4c8e1a157dfa4ba86f3 (diff) | |
download | makers-7029372c9fada6316852915765cc0d763be3c63c.tar.gz makers-7029372c9fada6316852915765cc0d763be3c63c.zip |
clippy moment
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() |