mirror of
https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation.git
synced 2026-08-24 06:24:19 +02:00
build(linting): Merge pull request #537 from /build/add-lints
build(linting): add more lints
This commit is contained in:
commit
413634eca8
6 changed files with 40 additions and 28 deletions
1
.github/release.yml
vendored
1
.github/release.yml
vendored
|
|
@ -11,6 +11,7 @@ changelog:
|
|||
- refactor
|
||||
- dependencies
|
||||
- documentation
|
||||
- testing
|
||||
- title: Packages/apps
|
||||
labels:
|
||||
- package::documentation
|
||||
|
|
|
|||
18
Cargo.toml
18
Cargo.toml
|
|
@ -51,3 +51,21 @@ strip = "symbols"
|
|||
|
||||
[build-dependencies]
|
||||
embed-resource = "2.4.2"
|
||||
|
||||
[lints.rust]
|
||||
# "forbid" may cause conflicts with libs (static and dynamic)
|
||||
unsafe_code = "deny"
|
||||
|
||||
[lints.clippy]
|
||||
undocumented_unsafe_blocks = "forbid"
|
||||
exit = "deny"
|
||||
panic_in_result_fn = "warn"
|
||||
unwrap_used = "warn"
|
||||
infinite_loop = "warn"
|
||||
mem_forget = "warn"
|
||||
string_to_string = "deny"
|
||||
format_push_string = "warn"
|
||||
large_include_file = "warn"
|
||||
shadow_unrelated = "warn"
|
||||
|
||||
pedantic = { level = "warn", priority = -1 }
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ pub async fn perform_adb_commands(
|
|||
label, action, err
|
||||
)));
|
||||
}
|
||||
Err(AdbError::Generic(err.to_string()))
|
||||
Err(AdbError::Generic(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,22 +192,18 @@ impl Application for UadGui {
|
|||
return self.update(Message::RefreshButtonPressed);
|
||||
}
|
||||
}
|
||||
SettingsMessage::MultiUserMode(toggled) => {
|
||||
if toggled {
|
||||
for user in self.apps_view.phone_packages.clone() {
|
||||
for (i, _) in
|
||||
user.iter().enumerate().filter(|&(_, pkg)| pkg.selected)
|
||||
SettingsMessage::MultiUserMode(toggled) if toggled => {
|
||||
for user in self.apps_view.phone_packages.clone() {
|
||||
for (i, _) in user.iter().filter(|&pkg| pkg.selected).enumerate() {
|
||||
for u in self
|
||||
.selected_device
|
||||
.as_ref()
|
||||
.expect("Device should be selected")
|
||||
.user_list
|
||||
.iter()
|
||||
.filter(|&u| !u.protected)
|
||||
{
|
||||
for u in self
|
||||
.selected_device
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.user_list
|
||||
.iter()
|
||||
.filter(|&u| !u.protected)
|
||||
{
|
||||
self.apps_view.phone_packages[u.index][i].selected = true;
|
||||
}
|
||||
self.apps_view.phone_packages[u.index][i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -235,19 +231,13 @@ impl Application for UadGui {
|
|||
}
|
||||
AboutMessage::DoSelfUpdate => {
|
||||
#[cfg(feature = "self-update")]
|
||||
if self.update_state.self_update.latest_release.is_some() {
|
||||
if let Some(release) = self.update_state.self_update.latest_release.as_ref()
|
||||
{
|
||||
self.update_state.self_update.status = SelfUpdateStatus::Updating;
|
||||
self.apps_view.loading_state = ListLoadingState::_UpdatingUad;
|
||||
let bin_name = bin_name().to_owned();
|
||||
let release = self
|
||||
.update_state
|
||||
.self_update
|
||||
.latest_release
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.clone();
|
||||
Command::perform(
|
||||
download_update_to_temp_file(bin_name, release),
|
||||
download_update_to_temp_file(bin_name, release.clone()),
|
||||
Message::_NewReleaseDownloaded,
|
||||
)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ impl Settings {
|
|||
Command::batch(commands)
|
||||
}
|
||||
Err(e) => {
|
||||
self.device.backup.backup_state = e.to_string();
|
||||
self.device.backup.backup_state = e.clone();
|
||||
error!("{} - {}", self.device.backup.selected.as_ref().unwrap(), e);
|
||||
Command::none()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,14 +190,17 @@ where
|
|||
clipboard: &mut dyn Clipboard,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
) -> event::Status {
|
||||
let content_bounds = layout.children().next().unwrap().bounds();
|
||||
|
||||
if let Some(message) = self.on_blur.as_ref() {
|
||||
if matches!(
|
||||
event,
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
||||
) {
|
||||
if let Some(cursor_position) = cursor.position() {
|
||||
let content_bounds = layout
|
||||
.children()
|
||||
.next()
|
||||
.expect("Layout must have at least 1 child")
|
||||
.bounds();
|
||||
if !content_bounds.contains(cursor_position) {
|
||||
shell.publish(message.clone());
|
||||
return event::Status::Captured;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue