clippy: Resolve needless_return

TEST=bin/clippy

Change-Id: I62eb3f86b01a6000107c54a967689d4e430adf50
Reviewed-on: https://chromium-review.googlesource.com/1566743
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
David Tolnay 2019-04-12 19:16:38 -07:00 committed by chrome-bot
parent c2d71acc45
commit 9239602d69
3 changed files with 7 additions and 8 deletions

View file

@ -14,7 +14,6 @@ cd ..
SUPPRESS=(
# To be resolved.
let_unit_value
needless_return
option_map_unit_fn
question_mark
range_plus_one

View file

@ -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)),
}
}

View file

@ -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))
}
}
}