From 0b6657d1b17c77906ef8627bb4aae2a9d38d2902 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 9 Jan 2021 17:13:34 +0800 Subject: [PATCH] Fix clippy. --- src/module/resolvers/file.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/module/resolvers/file.rs b/src/module/resolvers/file.rs index 841a2d4e..f7e41386 100644 --- a/src/module/resolvers/file.rs +++ b/src/module/resolvers/file.rs @@ -240,14 +240,12 @@ impl ModuleResolver for FileModuleResolver { file_path.set_extension(&self.extension); // Force extension // Load the script file and compile it - let mut ast = engine - .compile_file(file_path.clone()) - .map_err(|err| match *err { - EvalAltResult::ErrorSystem(_, err) if err.is::() => { - Box::new(EvalAltResult::ErrorModuleNotFound(path.to_string(), pos)) - } - _ => Box::new(EvalAltResult::ErrorInModule(path.to_string(), err, pos)), - })?; + let mut ast = engine.compile_file(file_path).map_err(|err| match *err { + EvalAltResult::ErrorSystem(_, err) if err.is::() => { + Box::new(EvalAltResult::ErrorModuleNotFound(path.to_string(), pos)) + } + _ => Box::new(EvalAltResult::ErrorInModule(path.to_string(), err, pos)), + })?; ast.set_source(path);