style: rm unused imports

This commit is contained in:
Rudxain 2024-09-24 18:28:02 -04:00
commit 8bead68916
3 changed files with 5 additions and 15 deletions

View file

@ -1,5 +1,5 @@
use crate::core::uad_lists::PackageState;
use crate::core::utils::ANDROID_SERIAL;
use crate::core::utils::set_adb_serial;
use crate::gui::views::list::PackageInfo;
use crate::gui::widgets::package_row::PackageRow;
use regex::Regex;
@ -7,14 +7,11 @@ use retry::{delay::Fixed, retry, OperationResult};
use serde::{Deserialize, Serialize};
use static_init::dynamic;
use std::collections::HashSet;
use std::env;
use std::process::Command;
#[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
use super::utils::set_adb_serial;
const PM_LS_PKG: &str = "pm list packages";
const PM_C: &str = "pm clear";

View file

@ -10,15 +10,8 @@ use std::path::PathBuf;
use std::process::Command;
use std::{fmt, fs};
use super::sync::Phone;
/// Canonical shortened name of the application
pub const NAME: &str = "UAD-ng";
/// Global environment variable to keep
/// track of the current device serial.
///
/// [More info](https://developer.android.com/tools/variables#adb)
pub const ANDROID_SERIAL: &str = "ANDROID_SERIAL";
pub const EXPORT_FILE_NAME: &str = "selection_export.txt";
pub const UNINSTALLED_PACKAGES_FILE_NAME: &str = "uninstalled_packages";
@ -32,8 +25,9 @@ pub enum Error {
clippy::semicolon_if_nothing_returned,
reason = "fn must return whatever `set_var` returns"
)]
pub unsafe fn set_adb_serial<D: AsRef<OsStr>>(device: D) {
std::env::set_var(ANDROID_SERIAL, device)
pub unsafe fn set_adb_serial<D: AsRef<OsStr>>(device_serial: D) {
// https://developer.android.com/tools/variables#adb
std::env::set_var("ANDROID_SERIAL", device_serial)
}
pub fn fetch_packages(uad_lists: &PackageHashMap, user_id: Option<&User>) -> Vec<PackageRow> {

View file

@ -6,7 +6,7 @@ use crate::core::sync::{get_devices_list, initial_load, perform_adb_commands, Co
use crate::core::theme::Theme;
use crate::core::uad_lists::UadListState;
use crate::core::update::{get_latest_release, Release, SelfUpdateState, SelfUpdateStatus};
use crate::core::utils::{set_adb_serial, string_to_theme, ANDROID_SERIAL, NAME};
use crate::core::utils::{set_adb_serial, string_to_theme, NAME};
use iced::advanced::graphics::image::image_rs::ImageFormat;
use iced::font;
@ -21,7 +21,6 @@ use iced::{
window::Settings as Window, Alignment, Application, Command, Element, Length, Renderer,
Settings,
};
use std::env;
#[cfg(feature = "self-update")]
use std::path::PathBuf;