refactor: cargo clippy --fix

This commit is contained in:
Rudxain 2025-03-05 23:10:20 -04:00 committed by Ricardo Fernández Serrata
commit 5a682e2889
3 changed files with 11 additions and 11 deletions

View file

@ -138,19 +138,19 @@ pub fn restore_backup(
};
for (i, backup_package) in u.packages.iter().enumerate() {
let package: CorePackage;
match packages[index]
let package: CorePackage = match packages[index]
.iter()
.find(|x| x.name == backup_package.name)
{
Some(p) => package = p.into(),
Some(p) => p.into(),
None => {
return Err(format!(
"{} not found for user {}",
backup_package.name, u.id
));
}
}
};
let p_commands = apply_pkg_state_commands(
&package,
backup_package.state,

View file

@ -182,8 +182,8 @@ pub fn get_latest_release() -> Result<Option<Release>, ()> {
pub fn get_latest_release() -> Result<Option<Release>, ()> {
debug!("Checking for {NAME} update");
match ureq::get("https://api.github.com/repos/Universal-Debloater-Alliance/universal-android-debloater/releases/latest")
.call() { Ok(res) => {
if let Ok(res) = ureq::get("https://api.github.com/repos/Universal-Debloater-Alliance/universal-android-debloater/releases/latest")
.call() {
let release: Release = serde_json::from_value(
res.into_json::<serde_json::Value>()
.map_err(|_| ())?
@ -200,10 +200,10 @@ pub fn get_latest_release() -> Result<Option<Release>, ()> {
} else {
Ok(None)
}
} _ => {
} else {
debug!("Failed to check {NAME} update");
Err(())
}}
}
}
/// Extracts the binary from a `tar.gz` archive to `temp_file` path

View file

@ -465,7 +465,9 @@ impl Settings {
.spacing(10)
.align_items(Alignment::Center);
let restore_row = if !self.device.backup.backups.is_empty() {
let restore_row = if self.device.backup.backups.is_empty() {
row![]
} else {
row![
restore_btn(true),
"Restore the state of the device",
@ -475,8 +477,6 @@ impl Settings {
]
.spacing(10)
.align_items(Alignment::Center)
} else {
row![]
};
let no_device_ctn = || {