From e2ef4f64e777f293a0408d0f60cfed9de69c7bb6 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 26 Jul 2020 17:28:43 +0200 Subject: =?UTF-8?q?Rename=20errors=20to=20problems=20and=20make=20error!?= =?UTF-8?q?=20macro=20more=20ergonomic=20=F0=9F=A7=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also adds a `warning!` macro. --- src/syntax/func/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/syntax/func/mod.rs') 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 OptionExt for Option { - 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 } -- cgit v1.2.3