summaryrefslogtreecommitdiff
path: root/src/func/args.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-04 20:20:02 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-04 20:20:02 +0100
commitf72b1505bebf8d2fe1a60d386a3a3c3b67d4f903 (patch)
tree09fa7137a2bae5454e6f9cecc1936633c90965d4 /src/func/args.rs
parent9fb31defd037a90bf8f9e38fa33acae23a70b269 (diff)
Unify error types ♾
Diffstat (limited to 'src/func/args.rs')
-rw-r--r--src/func/args.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/func/args.rs b/src/func/args.rs
index 2e9e80cc..d1d49b6a 100644
--- a/src/func/args.rs
+++ b/src/func/args.rs
@@ -64,14 +64,14 @@ impl<'a> ArgParser<'a> {
if self.positional_index == self.args.positional.len() {
Ok(())
} else {
- pr!("unexpected argument");
+ error!(unexpected_argument);
}
}
/// Covert an option to a result with an error on `None`.
fn expected<T>(val: Option<Spanned<T::Output>>) -> ParseResult<Spanned<T::Output>>
where T: Argument<'a> {
- val.ok_or_else(|| pr!(@"expected {}", T::ERROR_MESSAGE))
+ val.ok_or_else(|| error!(@"expected {}", T::ERROR_MESSAGE))
}
}
@@ -93,10 +93,10 @@ macro_rules! arg {
const ERROR_MESSAGE: &'static str = $err;
fn from_expr(expr: &'a Spanned<Expression>) -> ParseResult<Spanned<Self::Output>> {
- #[allow(unreachable_patterns)]
+ #[allow(unreachable_code)]
match &expr.val {
$wanted => Ok(Spanned::new($converted, expr.span)),
- _ => pr!("expected {}", $err),
+ _ => error!("expected {}", $err),
}
}
}
@@ -179,7 +179,7 @@ impl AlignmentKey {
Right if horizontal => axes.right(),
Top if !horizontal => axes.top(),
Bottom if !horizontal => axes.bottom(),
- _ => lr!(
+ _ => error!(
"invalid alignment `{}` for {} axis",
format!("{:?}", self).to_lowercase(),
format!("{:?}", axis).to_lowercase()