From 9239602d69306a45da78a595bed4a02aef105ea5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 12 Apr 2019 19:16:38 -0700 Subject: clippy: Resolve needless_return TEST=bin/clippy Change-Id: I62eb3f86b01a6000107c54a967689d4e430adf50 Reviewed-on: https://chromium-review.googlesource.com/1566743 Commit-Ready: David Tolnay Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: Daniel Verkamp --- bin/clippy | 1 - src/plugin/mod.rs | 12 ++++++------ vm_control/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/clippy b/bin/clippy index 5e5d329..f2a2a01 100755 --- a/bin/clippy +++ b/bin/clippy @@ -14,7 +14,6 @@ cd .. SUPPRESS=( # To be resolved. let_unit_value - needless_return option_map_unit_fn question_mark range_plus_one diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs index 60a50da..c01ff80 100644 --- a/src/plugin/mod.rs +++ b/src/plugin/mod.rs @@ -733,11 +733,11 @@ pub fn run_config(cfg: Config) -> Result<()> { match plugin.try_wait() { // The plugin has run out of time by now - Ok(ProcessStatus::Running) => return Err(Error::PluginTimeout), + Ok(ProcessStatus::Running) => Err(Error::PluginTimeout), // Return an error discovered earlier in this function. - Ok(ProcessStatus::Success) => return res, - Ok(ProcessStatus::Fail(code)) => return Err(Error::PluginFailed(code)), - Ok(ProcessStatus::Signal(code)) => return Err(Error::PluginKilled(code)), - Err(e) => return Err(Error::PluginWait(e)), - }; + Ok(ProcessStatus::Success) => res, + Ok(ProcessStatus::Fail(code)) => Err(Error::PluginFailed(code)), + Ok(ProcessStatus::Signal(code)) => Err(Error::PluginKilled(code)), + Err(e) => Err(Error::PluginWait(e)), + } } diff --git a/vm_control/src/lib.rs b/vm_control/src/lib.rs index ac974a1..fcf87e8 100644 --- a/vm_control/src/lib.rs +++ b/vm_control/src/lib.rs @@ -321,7 +321,7 @@ impl VmRequest { Ok(response) => VmResponse::UsbResponse(response), Err(e) => { error!("fail to recv command from usb control socket: {}", e); - return VmResponse::Err(SysError::new(EIO)); + VmResponse::Err(SysError::new(EIO)) } } } -- cgit 1.4.1