aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/pattern.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/pattern.rs')
-rw-r--r--src/makefile/pattern.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/makefile/pattern.rs b/src/makefile/pattern.rs
index 6648851..b47c75d 100644
--- a/src/makefile/pattern.rs
+++ b/src/makefile/pattern.rs
@@ -1,6 +1,7 @@
+use eyre::Result;
use regex::{Captures, Regex};
-fn compile_pattern(pattern: &str) -> anyhow::Result<Regex> {
+fn compile_pattern(pattern: &str) -> Result<Regex> {
let mut result = String::new();
for c in pattern.chars() {
if c == '%' {
@@ -24,7 +25,7 @@ fn compile_pattern(pattern: &str) -> anyhow::Result<Regex> {
Ok(Regex::new(&result)?)
}
-pub fn r#match<'a>(pattern: &str, text: &'a str) -> anyhow::Result<Option<Captures<'a>>> {
+pub fn r#match<'a>(pattern: &str, text: &'a str) -> Result<Option<Captures<'a>>> {
Ok(compile_pattern(pattern)?.captures(text))
}
@@ -32,7 +33,7 @@ pub fn r#match<'a>(pattern: &str, text: &'a str) -> anyhow::Result<Option<Captur
mod test {
use super::*;
- type R = anyhow::Result<()>;
+ type R = Result<()>;
#[test]
fn pattern_backslashes() -> R {