From f91d068c0f2372ab3d965c6691f0b78d98609653 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 13 Mar 2020 18:31:17 +0800 Subject: [PATCH] Update api.rs --- src/api.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.rs b/src/api.rs index 919e6460..c12d86bf 100644 --- a/src/api.rs +++ b/src/api.rs @@ -112,7 +112,7 @@ impl<'e> Engine<'e> { let mut contents = String::new(); f.read_to_string(&mut contents) - .map_err(|err| EvalAltResult::ErrorReadingScriptFile(filename.into(), err)) + .map_err(|err| EvalAltResult::ErrorReadingScriptFile(path.clone(), err)) .map(|_| contents) } @@ -210,7 +210,7 @@ impl<'e> Engine<'e> { path: PathBuf, retain_functions: bool, ) -> Result<(), EvalAltResult> { - Self::read_file(path).and_then(|_| self.consume(&contents, retain_functions)) + Self::read_file(path).and_then(|contents| self.consume(&contents, retain_functions)) } /// Evaluate a string, but throw away the result and only return error (if any).