Further clippy fixes (#176)

This commit is contained in:
Guilherme Silva
2022-11-13 07:29:33 -03:00
committed by Thomas Schönauer
parent 761ffac127
commit 7442ddd386
2 changed files with 19 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
use crate::command::CommandExt;
use crate::execution_context::ExecutionContext;
use crate::terminal::print_separator;
use crate::utils::require;
@@ -21,18 +22,16 @@ pub fn upgrade_packages(ctx: &ExecutionContext) -> Result<()> {
}
command.status_checked()?;
if !is_nala {
if ctx.config().cleanup() {
ctx.run_type().execute(&pkg).arg("clean").status_checked()?;
if !is_nala && ctx.config().cleanup() {
ctx.run_type().execute(&pkg).arg("clean").status_checked()?;
let apt = require("apt")?;
let mut command = ctx.run_type().execute(&apt);
command.arg("autoremove");
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.status_checked()?;
let apt = require("apt")?;
let mut command = ctx.run_type().execute(&apt);
command.arg("autoremove");
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.status_checked()?;
}
Ok(())