From 439d4d1d989cd5392c636581f980c603920b8d1b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 4 Jun 2019 20:37:24 -0400 Subject: [PATCH] clippy --- cli/main.rs | 4 ++-- cli/worker.rs | 5 ++--- core/modules.rs | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cli/main.rs b/cli/main.rs index ac9e5404004644..d530010b2efe44 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -204,7 +204,7 @@ fn fetch_or_info_command( js_check(result); Ok(()) }) - }).map_err(|err| print_err_and_exit(err)) + }).map_err(print_err_and_exit) }); tokio_util::run(main_future); } @@ -297,7 +297,7 @@ fn run_script(flags: DenoFlags, argv: Vec) { js_check(result); Ok(()) }) - }).map_err(|err| print_err_and_exit(err)) + }).map_err(print_err_and_exit) }); tokio_util::run(main_future); } diff --git a/cli/worker.rs b/cli/worker.rs index 25c0430bdb8b3a..f95826674f8ab9 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -87,13 +87,12 @@ impl Worker { }).map_err(move |err| { worker_.state.progress.done(); // Convert to RustOrJsError AND apply_source_map. - let err = match err { + match err { deno::JSErrorOr::JSError(err) => { RustOrJsError::Js(worker_.apply_source_map(err)) } deno::JSErrorOr::Other(err) => RustOrJsError::Rust(err), - }; - err + } }) } diff --git a/core/modules.rs b/core/modules.rs index 07b25434c49afc..b198dd26aea8c6 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -233,7 +233,7 @@ impl Future for RecursiveLoad { for specifier in imports { self .add(&specifier, referrer, Some(mod_id)) - .map_err(|e| JSErrorOr::Other(e))?; + .map_err(JSErrorOr::Other)?; } } else if need_alias { let mut modules = self.modules.lock().unwrap();