From 55a3064fa7f0dd8cfd3655b6a078c299e340f6bf Mon Sep 17 00:00:00 2001 From: David Campbell Date: Thu, 19 Sep 2024 14:19:59 -0400 Subject: [PATCH] Fix obvious clippy warnings. --- src/uu/runcon/src/errors.rs | 14 +++++++------- src/uu/runcon/src/runcon.rs | 2 +- src/uucore/src/lib/features/proc_info.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/uu/runcon/src/errors.rs b/src/uu/runcon/src/errors.rs index 9ffd24da4..cbb7dc9ae 100644 --- a/src/uu/runcon/src/errors.rs +++ b/src/uu/runcon/src/errors.rs @@ -121,13 +121,13 @@ impl Display for RunconError { impl UError for Error { fn code(&self) -> i32 { match self { - Error::MissingCommand => error_exit_status::ANOTHER_ERROR, - Error::SELinuxNotEnabled => error_exit_status::ANOTHER_ERROR, - Error::NotUTF8(_) => error_exit_status::ANOTHER_ERROR, - Error::CommandLine(e) => e.exit_code(), - Error::SELinux { .. } => error_exit_status::ANOTHER_ERROR, - Error::Io { .. } => error_exit_status::ANOTHER_ERROR, - Error::Io1 { .. } => error_exit_status::ANOTHER_ERROR, + Self::MissingCommand => error_exit_status::ANOTHER_ERROR, + Self::SELinuxNotEnabled => error_exit_status::ANOTHER_ERROR, + Self::NotUTF8(_) => error_exit_status::ANOTHER_ERROR, + Self::CommandLine(e) => e.exit_code(), + Self::SELinux { .. } => error_exit_status::ANOTHER_ERROR, + Self::Io { .. } => error_exit_status::ANOTHER_ERROR, + Self::Io1 { .. } => error_exit_status::ANOTHER_ERROR, } } } diff --git a/src/uu/runcon/src/runcon.rs b/src/uu/runcon/src/runcon.rs index c41dcdcf1..c3e9b6832 100644 --- a/src/uu/runcon/src/runcon.rs +++ b/src/uu/runcon/src/runcon.rs @@ -42,7 +42,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { let options = match parse_command_line(config, args) { Ok(r) => r, Err(r) => { - return Err(r.into()); + return Err(r); } }; diff --git a/src/uucore/src/lib/features/proc_info.rs b/src/uucore/src/lib/features/proc_info.rs index aa143a22b..7c812ec2a 100644 --- a/src/uucore/src/lib/features/proc_info.rs +++ b/src/uucore/src/lib/features/proc_info.rs @@ -370,7 +370,7 @@ mod tests { fn test_pid_entry() { let current_pid = current_pid(); - let mut pid_entry = ProcessInformation::try_new( + let pid_entry = ProcessInformation::try_new( PathBuf::from_str(&format!("/proc/{}", current_pid)).unwrap(), ) .unwrap();