Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Nov 9, 2024
1 parent 1ddd8db commit 228c0e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ pub struct Colors {
pub warning: Style,
pub bold: Style,
pub upgrade: Style,
pub base: Style,
//pub base: Style,
pub action: Style,
pub sl_repo: Style,
pub sl_pkg: Style,
pub sl_version: Style,
pub sl_installed: Style,
pub ss_repo: Style,
//pub ss_repo: Style,
pub ss_name: Style,
pub ss_ver: Style,
pub ss_stats: Style,
Expand Down Expand Up @@ -120,13 +120,13 @@ impl Colors {
warning: Style::new().fg(Yellow),
bold: Style::new().bold(),
upgrade: Style::new().fg(Green).bold(),
base: Style::new().fg(Blue),
//base: Style::new().fg(Blue),
action: Style::new().fg(Blue).bold(),
sl_repo: Style::new().fg(Purple).bold(),
sl_pkg: Style::new().bold(),
sl_version: Style::new().fg(Green).bold(),
sl_installed: Style::new().fg(Cyan).bold(),
ss_repo: Style::new().fg(Blue).bold(),
//ss_repo: Style::new().fg(Blue).bold(),
ss_name: Style::new().bold(),
ss_ver: Style::new().fg(Green).bold(),
ss_stats: Style::new().bold(),
Expand Down
15 changes: 1 addition & 14 deletions src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ use tr::tr;
pub struct Upgrades {
pub aur_repos: HashMap<String, String>,
pub pkgbuild_keep: Vec<(String, String)>,
pub pkgbuild_skip: Vec<(String, String)>,
pub repo_keep: Vec<String>,
pub repo_skip: Vec<String>,
pub aur_keep: Vec<String>,
pub aur_skip: Vec<String>,
pub devel: HashSet<String>,
}

Expand Down Expand Up @@ -233,10 +231,8 @@ pub async fn get_upgrades<'a, 'b>(

let mut repo_skip = Vec::new();
let mut repo_keep = Vec::new();
let mut aur_skip = Vec::new();
let mut aur_keep = Vec::new();
let mut custom_keep = Vec::new();
let mut custom_skip = Vec::new();

let mut aur_repos = HashMap::new();
for pkg in &aur_upgrades {
Expand Down Expand Up @@ -274,11 +270,9 @@ pub async fn get_upgrades<'a, 'b>(

let upgrades = Upgrades {
pkgbuild_keep: pkgbuild_updates,
pkgbuild_skip: custom_skip,
aur_repos,
repo_keep: repo_upgrades.iter().map(|p| p.name().to_string()).collect(),
aur_keep: aur,
aur_skip,
repo_skip,
devel: devel_upgrades.into_iter().map(|t| t.pkg).collect(),
};
Expand Down Expand Up @@ -427,8 +421,6 @@ pub async fn get_upgrades<'a, 'b>(
.unwrap_or("aur");
if !number_menu.contains(index, remote) || input.is_empty() {
aur_keep.push(pkg.local.name().to_string());
} else {
aur_skip.push(pkg.local.name().to_string());
}
index -= 1;
}
Expand All @@ -445,9 +437,8 @@ pub async fn get_upgrades<'a, 'b>(

match (keep, is_aur) {
(true, true) => aur_keep.push(pkg.pkg.to_string()),
(false, true) => aur_skip.push(pkg.pkg.to_string()),
(true, false) => custom_keep.push((pkg.repo.clone().unwrap(), pkg.pkg.clone())),
(false, false) => custom_skip.push((pkg.repo.clone().unwrap(), pkg.pkg.clone())),
(false, _) => (),
}

index -= 1;
Expand All @@ -460,20 +451,16 @@ pub async fn get_upgrades<'a, 'b>(
.unwrap_or(&pkg.repo);
if !number_menu.contains(index, remote) || input.is_empty() {
custom_keep.push((pkg.repo.clone(), pkg.local.name().to_string()));
} else {
custom_skip.push((pkg.repo.clone(), pkg.local.name().to_string()));
}
index -= 1;
}

let upgrades = Upgrades {
pkgbuild_keep: custom_keep,
pkgbuild_skip: custom_skip,
aur_repos,
repo_keep,
repo_skip,
aur_keep,
aur_skip,
devel: devel_upgrades.into_iter().map(|t| t.pkg).collect(),
};

Expand Down

0 comments on commit 228c0e8

Please sign in to comment.