[desktop] Fix all clippy warning. Add clippy to CI.
This commit is contained in:
@@ -26,7 +26,7 @@ impl From<std::process::Output> for ServiceManagerError {
|
||||
.ok()
|
||||
.filter(|s| !s.trim().is_empty())
|
||||
})
|
||||
.unwrap_or_else(|| format!("Failed to run `systemctl`"));
|
||||
.unwrap_or_else(|| "Failed to run `systemctl`".to_string());
|
||||
|
||||
ServiceManagerError::Other(output.status, msg)
|
||||
}
|
||||
@@ -231,11 +231,11 @@ fn trim_newline(s: &mut String) {
|
||||
}
|
||||
|
||||
fn get_sudo_cmd() -> std::result::Result<SudoCommand, std::io::Error> {
|
||||
if let Ok(_) = fs::metadata("/usr/bin/pkexec") {
|
||||
if fs::metadata("/usr/bin/pkexec").is_ok() {
|
||||
return Ok(SudoCommand::Pkexec);
|
||||
}
|
||||
|
||||
if let Ok(_) = fs::metadata("/usr/bin/gksudo") {
|
||||
if fs::metadata("/usr/bin/gksudo").is_ok() {
|
||||
return Ok(SudoCommand::Gksu);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user