Fix clippy warnings across native codebase

Address clippy warnings including collapsible match statements in
bootstages, daemon, su daemon, and db modules, as well as iterator
loops in files.rs.

Assisted-by: Gemini 3.6 Flash
This commit is contained in:
topjohnwu
2026-07-31 22:57:41 -07:00
committed by John Wu
parent 05099cce89
commit d04635478a
5 changed files with 30 additions and 53 deletions
+13 -17
View File
@@ -226,25 +226,21 @@ impl MagiskD {
| RequestCode::ZYGOTE_RESTART
| RequestCode::SQLITE_CMD
| RequestCode::DENYLIST
| RequestCode::STOP_DAEMON => {
if !is_root {
client.write_pod(&RespondCode::ROOT_REQUIRED.repr).log_ok();
return;
}
| RequestCode::STOP_DAEMON
if !is_root =>
{
client.write_pod(&RespondCode::ROOT_REQUIRED.repr).log_ok();
return;
}
RequestCode::REMOVE_MODULES => {
if !is_root && !is_shell {
// Only allow root and ADB shell to remove modules
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
return;
}
RequestCode::REMOVE_MODULES if !is_root && !is_shell => {
// Only allow root and ADB shell to remove modules
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
return;
}
RequestCode::ZYGISK => {
if !is_zygote {
// Invalid client context
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
return;
}
RequestCode::ZYGISK if !is_zygote => {
// Invalid client context
client.write_pod(&RespondCode::ACCESS_DENIED.repr).log_ok();
return;
}
_ => {}
}