From ae0a56cdffa515ed6bb7cb566c025cc66ff00f33 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 15 Mar 2022 11:30:13 +0100 Subject: Non-returning error macro --- tests/typeset.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/typeset.rs b/tests/typeset.rs index dfc8bff9..5e9b79fe 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -18,7 +18,7 @@ use typst::loading::FsLoader; use typst::parse::Scanner; use typst::source::SourceFile; use typst::syntax::Span; -use typst::Context; +use typst::{bail, Context}; const TYP_DIR: &str = "./typ"; const REF_DIR: &str = "./ref"; @@ -77,10 +77,7 @@ fn main() { let lhs = args.expect::("left-hand side")?; let rhs = args.expect::("right-hand side")?; if lhs != rhs { - return Err(Error::boxed( - args.span, - format!("Assertion failed: {:?} != {:?}", lhs, rhs), - )); + bail!(args.span, "Assertion failed: {:?} != {:?}", lhs, rhs,); } Ok(Value::None) }); -- cgit v1.2.3