chore(ksud): enable clippy::all, clippy::pedantic && make clippy happy (#617)

* Revert "chore(ksud): bump ksud's deps (#585)"
* Because it may cause compilation errors.

This reverts commit c8020b2066.

* chore(ksud): remove unused Result

Signed-off-by: Tools-app <localhost.hutao@gmail.com>

* chore(ksud): enable clippy::all, clippy::pedantic && make clippy happy

https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or

https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items

https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls

https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate
...
and use some #![allow(...)] or #[allow(...)]

Signed-off-by: Tools-app <localhost.hutao@gmail.com>

---------

Signed-off-by: Tools-app <localhost.hutao@gmail.com>
This commit is contained in:
生于生时 亡于亡刻
2025-11-22 06:09:45 +08:00
committed by GitHub
parent a772a0f82d
commit d0e8faea77
20 changed files with 829 additions and 784 deletions

View File

@@ -58,13 +58,11 @@ pub fn mark_get(pid: i32) -> Result<()> {
let result = ksucalls::mark_get(pid)?;
if pid == 0 {
bail!("Please specify a pid to get its mark status");
} else {
println!(
"Process {} mark status: {}",
pid,
if result != 0 { "marked" } else { "unmarked" }
);
}
println!(
"Process {pid} mark status: {}",
if result != 0 { "marked" } else { "unmarked" }
);
Ok(())
}
@@ -74,7 +72,7 @@ pub fn mark_set(pid: i32) -> Result<()> {
if pid == 0 {
println!("All processes marked successfully");
} else {
println!("Process {} marked successfully", pid);
println!("Process {pid} marked successfully");
}
Ok(())
}
@@ -85,7 +83,7 @@ pub fn mark_unset(pid: i32) -> Result<()> {
if pid == 0 {
println!("All processes unmarked successfully");
} else {
println!("Process {} unmarked successfully", pid);
println!("Process {pid} unmarked successfully");
}
Ok(())
}