git.delta.rocks / jrsonnet / refs/commits / 57ad354a9478

difftreelog

perf reduce error enum size

Lach2020-08-23parent: #6e40dd4.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
1use crate::{builtin::format::FormatError, Val, ValType};1use crate::{builtin::format::FormatError, ValType};
2use jrsonnet_parser::{BinaryOpType, ExprLocation, UnaryOpType};2use jrsonnet_parser::{BinaryOpType, ExprLocation, UnaryOpType};
3use std::{path::PathBuf, rc::Rc};3use std::{path::PathBuf, rc::Rc};
44
1818
19 ArrayBoundsError(usize, usize),19 ArrayBoundsError(usize, usize),
2020
21 AssertionFailed(Val),21 AssertionFailed(Rc<str>),
2222
23 VariableIsNotDefined(String),23 VariableIsNotDefined(String),
24 TypeMismatch(&'static str, Vec<ValType>, ValType),24 TypeMismatch(&'static str, Vec<ValType>, ValType),
50 ImportSyntaxError {50 ImportSyntaxError {
51 path: Rc<PathBuf>,51 path: Rc<PathBuf>,
52 source_code: Rc<str>,52 source_code: Rc<str>,
53 error: jrsonnet_parser::ParseError,53 error: Box<jrsonnet_parser::ParseError>,
54 },54 },
5555
56 RuntimeError(Rc<str>),56 RuntimeError(Rc<str>),
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -155,7 +155,7 @@
 				},
 			)
 			.map_err(|error| ImportSyntaxError {
-				error,
+				error: Box::new(error),
 				path,
 				source_code,
 			})?,