aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/token.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-01 17:44:50 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-01 17:44:50 -0600
commit093e58de2ffc8243e6ff929f50a2aaa6ef60848b (patch)
treebe2003c6fd8d774f9462f4c0bd2ddae2af92f238 /src/makefile/token.rs
parente1128fe55d91ca60086de45c911b4568d2eec9ee (diff)
downloadmakers-093e58de2ffc8243e6ff929f50a2aaa6ef60848b.tar.gz
makers-093e58de2ffc8243e6ff929f50a2aaa6ef60848b.zip
slightly fancier errors
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r--src/makefile/token.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs
index 16403ff..076ac60 100644
--- a/src/makefile/token.rs
+++ b/src/makefile/token.rs
@@ -1,7 +1,7 @@
use std::fmt;
use std::str::FromStr;
-use anyhow::Context;
+use eyre::WrapErr;
use nom::{
branch::alt,
bytes::complete::{tag, take_till1, take_while1},
@@ -252,16 +252,16 @@ fn full_text_tokens(input: &str) -> IResult<&str, TokenString> {
all_consuming(tokens_but_not(vec![]))(input)
}
-pub fn tokenize(input: &str) -> anyhow::Result<TokenString> {
+pub fn tokenize(input: &str) -> eyre::Result<TokenString> {
let (_, result) = full_text_tokens(input)
.finish()
- .map_err(|err| anyhow::anyhow!(err.to_string()))
+ .map_err(|err| eyre::eyre!(err.to_string()))
.with_context(|| format!("couldn't parse {:?}", input))?;
Ok(result)
}
impl FromStr for TokenString {
- type Err = anyhow::Error;
+ type Err = eyre::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
tokenize(s)