mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
serial: fix clippy warnings
Resolve couple of minor clippy warnings: - unneeded return statement in last expression of the function - redundant closure BUG=None TEST=./bin/clippy TEST=cargo build Change-Id: I602e56289315cb88779c0029d400b24a8180b899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1646738 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Jakub Staroń <jstaron@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
This commit is contained in:
parent
4197d3a3a1
commit
d879219ac0
1 changed files with 6 additions and 6 deletions
|
@ -110,11 +110,11 @@ impl FromStr for SerialType {
|
|||
type Err = Error;
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
match s {
|
||||
"file" | "File" => return Ok(SerialType::File),
|
||||
"stdout" | "Stdout" => return Ok(SerialType::Stdout),
|
||||
"sink" | "Sink" => return Ok(SerialType::Sink),
|
||||
"syslog" | "Syslog" => return Ok(SerialType::Syslog),
|
||||
"unix" | "UnixSocket" => return Ok(SerialType::UnixSocket),
|
||||
"file" | "File" => Ok(SerialType::File),
|
||||
"stdout" | "Stdout" => Ok(SerialType::Stdout),
|
||||
"sink" | "Sink" => Ok(SerialType::Sink),
|
||||
"syslog" | "Syslog" => Ok(SerialType::Syslog),
|
||||
"unix" | "UnixSocket" => Ok(SerialType::UnixSocket),
|
||||
_ => Err(Error::InvalidSerialType(s.to_string())),
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ impl SerialParameters {
|
|||
None => Err(Error::PathRequired),
|
||||
Some(path) => Ok(Serial::new_out(
|
||||
evt_fd.try_clone().map_err(Error::CloneEventFd)?,
|
||||
Box::new(File::create(path.as_path()).map_err(|e| Error::FileError(e))?),
|
||||
Box::new(File::create(path.as_path()).map_err(Error::FileError)?),
|
||||
)),
|
||||
},
|
||||
SerialType::UnixSocket => Err(Error::Unimplemented(SerialType::UnixSocket)),
|
||||
|
|
Loading…
Reference in a new issue