From 7029372c9fada6316852915765cc0d763be3c63c Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 10 Nov 2024 16:02:48 -0700 Subject: clippy moment --- src/makefile/inference_rules.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/makefile/inference_rules.rs') 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() -- cgit v1.2.3