summaryrefslogtreecommitdiff
path: root/src/syntax/func/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-07-26 17:41:07 +0200
committerGitHub <noreply@github.com>2020-07-26 17:41:07 +0200
commite7ffdde43d09f60238590723c2829554806e23d5 (patch)
tree616ae4474f0dec5cc70fe3fa46b5f3c4b305a1be /src/syntax/func/mod.rs
parent0e8c2cad6e4fee283f8f2d6fb9a571173b59fda2 (diff)
parente2ef4f64e777f293a0408d0f60cfed9de69c7bb6 (diff)
Merge pull request #5 from typst/problems-and-error-macro
Rename errors to problems and make error! macro more ergonomic
Diffstat (limited to 'src/syntax/func/mod.rs')
-rw-r--r--src/syntax/func/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax/func/mod.rs b/src/syntax/func/mod.rs
index fd516208..d379b407 100644
--- a/src/syntax/func/mod.rs
+++ b/src/syntax/func/mod.rs
@@ -1,7 +1,7 @@
//! Primitives for argument parsing in library functions.
use std::iter::FromIterator;
-use crate::error::{Error, Errors};
+use crate::problem::{Problem, Problems};
use super::expr::{Expr, Ident, Tuple, Object, Pair};
use super::span::{Span, Spanned};
@@ -84,13 +84,13 @@ pub enum FuncArg {
pub trait OptionExt: Sized {
/// Add an error about a missing argument `arg` with the given span if the
/// option is `None`.
- fn or_missing(self, errors: &mut Errors, span: Span, arg: &str) -> Self;
+ fn or_missing(self, problems: &mut Problems, span: Span, arg: &str) -> Self;
}
impl<T> OptionExt for Option<T> {
- fn or_missing(self, errors: &mut Errors, span: Span, arg: &str) -> Self {
+ fn or_missing(self, problems: &mut Problems, span: Span, arg: &str) -> Self {
if self.is_none() {
- errors.push(err!(span; "missing argument: {}", arg));
+ problems.push(error!(span, "missing argument: {}", arg));
}
self
}