Merge pull request #6716 from dcampbell24/fix-clippy

Fix clippy warnings.
This commit is contained in:
Sylvestre Ledru 2024-09-19 21:36:51 +02:00 committed by GitHub
commit 98460132fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View file

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

View file

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

View file

@ -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();