git.delta.rocks / jrsonnet / refs/commits / d4fc7a8940c7

difftreelog

feat(evaluator) specify error type

Лач2020-06-06parent: #9dc4a3f.patch.diff
in: master

1 file changed

modifiedcrates/jsonnet-evaluator/src/lib.rsdiffbeforeafterboth
63#[derive(Default, Clone)]63#[derive(Default, Clone)]
64pub struct EvaluationState(Rc<EvaluationStateInternals>);64pub struct EvaluationState(Rc<EvaluationStateInternals>);
65impl EvaluationState {65impl EvaluationState {
66 pub fn add_file(66 pub fn add_file(&self, name: PathBuf, code: String) -> std::result::Result<(), ParseError> {
67 &self,
68 name: PathBuf,
69 code: String,
70 ) -> std::result::Result<(), Box<dyn std::error::Error>> {
71 self.0.files.borrow_mut().insert(67 self.0.files.borrow_mut().insert(
72 name.clone(),68 name.clone(),
73 FileData(69 FileData(
90 name: PathBuf,86 name: PathBuf,
91 code: String,87 code: String,
92 parsed: LocExpr,88 parsed: LocExpr,
93 ) -> std::result::Result<(), Box<dyn std::error::Error>> {89 ) -> std::result::Result<(), ()> {
94 self.090 self.0
95 .files91 .files
96 .borrow_mut()92 .borrow_mut()