git.delta.rocks / jrsonnet / refs/commits / 7288e541bb59

difftreelog

feat(evaluator) error cloning

Лач2020-06-25parent: #143bb30.patch.diff
in: master

2 files changed

modifiedcrates/jsonnet-evaluator/src/error.rsdiffbeforeafterboth
2use jsonnet_parser::LocExpr;2use jsonnet_parser::LocExpr;
3use std::path::PathBuf;3use std::path::PathBuf;
44
5#[derive(Debug)]5#[derive(Debug, Clone)]
6pub enum Error {6pub enum Error {
7 VariableIsNotDefined(String),7 VariableIsNotDefined(String),
8 TypeMismatch(&'static str, Vec<ValType>, ValType),8 TypeMismatch(&'static str, Vec<ValType>, ValType),
3939
40#[derive(Clone, Debug)]40#[derive(Clone, Debug)]
41pub struct StackTraceElement(pub LocExpr, pub String);41pub struct StackTraceElement(pub LocExpr, pub String);
42#[derive(Debug)]42#[derive(Debug, Clone)]
43pub struct StackTrace(pub Vec<StackTraceElement>);43pub struct StackTrace(pub Vec<StackTraceElement>);
4444
45#[derive(Debug)]45#[derive(Debug, Clone)]
46pub struct LocError(pub Error, pub StackTrace);46pub struct LocError(pub Error, pub StackTrace);
47pub type Result<V> = std::result::Result<V, LocError>;47pub type Result<V> = std::result::Result<V, LocError>;
4848
modifiedcrates/jsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jsonnet-evaluator/src/val.rs
+++ b/crates/jsonnet-evaluator/src/val.rs
@@ -96,7 +96,7 @@
 	}
 }
 
-#[derive(Debug)]
+#[derive(Debug, Clone)]
 pub enum ValType {
 	Bool,
 	Null,