Further clippy fixes (#176)
This commit is contained in:
committed by
Thomas Schönauer
parent
761ffac127
commit
7442ddd386
@@ -1,3 +1,4 @@
|
|||||||
|
use crate::command::CommandExt;
|
||||||
use crate::execution_context::ExecutionContext;
|
use crate::execution_context::ExecutionContext;
|
||||||
use crate::terminal::print_separator;
|
use crate::terminal::print_separator;
|
||||||
use crate::utils::require;
|
use crate::utils::require;
|
||||||
@@ -21,18 +22,16 @@ pub fn upgrade_packages(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
}
|
}
|
||||||
command.status_checked()?;
|
command.status_checked()?;
|
||||||
|
|
||||||
if !is_nala {
|
if !is_nala && ctx.config().cleanup() {
|
||||||
if ctx.config().cleanup() {
|
ctx.run_type().execute(&pkg).arg("clean").status_checked()?;
|
||||||
ctx.run_type().execute(&pkg).arg("clean").status_checked()?;
|
|
||||||
|
|
||||||
let apt = require("apt")?;
|
let apt = require("apt")?;
|
||||||
let mut command = ctx.run_type().execute(&apt);
|
let mut command = ctx.run_type().execute(&apt);
|
||||||
command.arg("autoremove");
|
command.arg("autoremove");
|
||||||
if ctx.config().yes(Step::System) {
|
if ctx.config().yes(Step::System) {
|
||||||
command.arg("-y");
|
command.arg("-y");
|
||||||
}
|
|
||||||
command.status_checked()?;
|
|
||||||
}
|
}
|
||||||
|
command.status_checked()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -14,23 +14,30 @@ use log::debug;
|
|||||||
|
|
||||||
use crate::error::SkipStep;
|
use crate::error::SkipStep;
|
||||||
use crate::execution_context::ExecutionContext;
|
use crate::execution_context::ExecutionContext;
|
||||||
use crate::executor::{Executor, RunType};
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
|
use crate::executor::Executor;
|
||||||
|
use crate::executor::RunType;
|
||||||
use crate::terminal::print_separator;
|
use crate::terminal::print_separator;
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(any(target_os = "android", target_os = "macos")))]
|
||||||
use crate::utils::require_option;
|
use crate::utils::require_option;
|
||||||
use crate::utils::{require, PathExt};
|
use crate::utils::{require, PathExt};
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
const INTEL_BREW: &str = "/usr/local/bin/brew";
|
const INTEL_BREW: &str = "/usr/local/bin/brew";
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
const ARM_BREW: &str = "/opt/homebrew/bin/brew";
|
const ARM_BREW: &str = "/opt/homebrew/bin/brew";
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
pub enum BrewVariant {
|
pub enum BrewVariant {
|
||||||
Path,
|
Path,
|
||||||
MacIntel,
|
MacIntel,
|
||||||
MacArm,
|
MacArm,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
impl BrewVariant {
|
impl BrewVariant {
|
||||||
fn binary_name(self) -> &'static str {
|
fn binary_name(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
@@ -223,6 +230,7 @@ pub fn upgrade_gnome_extensions(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
.status_checked()
|
.status_checked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> {
|
pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> {
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
let binary_name = require(variant.binary_name())?;
|
let binary_name = require(variant.binary_name())?;
|
||||||
|
|||||||
Reference in New Issue
Block a user