summaryrefslogtreecommitdiff
path: root/src/eval/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-03-15 11:30:13 +0100
committerLaurenz <laurmaedje@gmail.com>2022-03-15 11:30:13 +0100
commitae0a56cdffa515ed6bb7cb566c025cc66ff00f33 (patch)
tree586f4b12af74c7fc29e34960bab004b39425195c /src/eval/mod.rs
parent6f5b721fe56fe6e3735d03b07e3716fc39572639 (diff)
Non-returning error macro
Diffstat (limited to 'src/eval/mod.rs')
-rw-r--r--src/eval/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index e00a40f2..4ccf377b 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -37,7 +37,7 @@ pub use value::*;
use unicode_segmentation::UnicodeSegmentation;
-use crate::diag::{At, Error, StrResult, Trace, Tracepoint, TypResult};
+use crate::diag::{At, StrResult, Trace, Tracepoint, TypResult};
use crate::geom::{Angle, Fractional, Length, Relative};
use crate::library;
use crate::syntax::ast::*;
@@ -725,11 +725,9 @@ impl Eval for IncludeExpr {
fn import(ctx: &mut Context, path: &str, span: Span) -> TypResult<Module> {
// Load the source file.
let full = ctx.resolve(path);
- let id = ctx.sources.load(&full).map_err(|err| {
- Error::boxed(span, match err.kind() {
- std::io::ErrorKind::NotFound => "file not found".into(),
- _ => format!("failed to load source file ({})", err),
- })
+ let id = ctx.sources.load(&full).map_err(|err| match err.kind() {
+ std::io::ErrorKind::NotFound => error!(span, "file not found"),
+ _ => error!(span, "failed to load source file ({})", err),
})?;
// Prevent cyclic importing.