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
+6 -10
View File
@@ -252,17 +252,13 @@ impl MagiskD {
warn!("Root access is disabled!");
return Ok(Arc::new(SuInfo::deny(uid)));
}
RootAccess::AdbOnly => {
if uid != AID_SHELL {
warn!("Root access limited to ADB only!");
return Ok(Arc::new(SuInfo::deny(uid)));
}
RootAccess::AdbOnly if uid != AID_SHELL => {
warn!("Root access limited to ADB only!");
return Ok(Arc::new(SuInfo::deny(uid)));
}
RootAccess::AppsOnly => {
if uid == AID_SHELL {
warn!("Root access is disabled for ADB!");
return Ok(Arc::new(SuInfo::deny(uid)));
}
RootAccess::AppsOnly if uid == AID_SHELL => {
warn!("Root access is disabled for ADB!");
return Ok(Arc::new(SuInfo::deny(uid)));
}
_ => {}
};
+3 -15
View File
@@ -95,26 +95,14 @@ impl MagiskD {
// Check user root access settings
match cfg.root_access {
RootAccess::Disabled => return false,
RootAccess::AppsOnly => {
if uid == AID_SHELL {
return false;
}
}
RootAccess::AdbOnly => {
if uid != AID_SHELL {
return false;
}
}
RootAccess::AppsOnly if uid == AID_SHELL => return false,
RootAccess::AdbOnly if uid != AID_SHELL => return false,
_ => {}
}
// Check multiuser settings
match cfg.multiuser_mode {
MultiuserMode::OwnerOnly => {
if to_user_id(uid) != 0 {
return false;
}
}
MultiuserMode::OwnerOnly if to_user_id(uid) != 0 => return false,
MultiuserMode::OwnerManaged => uid = to_app_id(uid),
_ => {}
}