diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-01 17:44:50 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-01 17:44:50 -0600 |
commit | 093e58de2ffc8243e6ff929f50a2aaa6ef60848b (patch) | |
tree | be2003c6fd8d774f9462f4c0bd2ddae2af92f238 /src/makefile/conditional.rs | |
parent | e1128fe55d91ca60086de45c911b4568d2eec9ee (diff) | |
download | makers-093e58de2ffc8243e6ff929f50a2aaa6ef60848b.tar.gz makers-093e58de2ffc8243e6ff929f50a2aaa6ef60848b.zip |
slightly fancier errors
Diffstat (limited to 'src/makefile/conditional.rs')
-rw-r--r-- | src/makefile/conditional.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/makefile/conditional.rs b/src/makefile/conditional.rs index 0b4de01..149638e 100644 --- a/src/makefile/conditional.rs +++ b/src/makefile/conditional.rs @@ -1,4 +1,4 @@ -use anyhow::bail; +use eyre::{bail, Result}; use super::token::TokenString; @@ -83,8 +83,8 @@ fn decode_condition_args(line_body: &str) -> Option<(TokenString, TokenString)> impl Line { pub fn from( line: &str, - expand_macro: impl Fn(&TokenString) -> anyhow::Result<String>, - ) -> anyhow::Result<Option<Self>> { + expand_macro: impl Fn(&TokenString) -> Result<String>, + ) -> Result<Option<Self>> { Ok(Some(if let Some(line) = line.strip_prefix("ifeq ") { match decode_condition_args(line) { Some((arg1, arg2)) => Self::IfEqual(arg1, arg2), @@ -117,8 +117,8 @@ impl Line { &self, current_state: Option<&State>, is_macro_defined: impl Fn(&str) -> bool, - expand_macro: impl Fn(&TokenString) -> anyhow::Result<String>, - ) -> anyhow::Result<StateAction> { + expand_macro: impl Fn(&TokenString) -> Result<String>, + ) -> Result<StateAction> { Ok(match self { Self::IfEqual(arg1, arg2) => { let arg1 = expand_macro(arg1)?; |