cleanup
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
use std::{borrow::Cow, sync::LazyLock, time::Instant};
|
||||
use std::{borrow::Cow, time::Instant};
|
||||
|
||||
use indicatif::{HumanBytes, ProgressBar};
|
||||
use owo_colors::{OwoColorize, Style};
|
||||
use owo_colors::Style;
|
||||
|
||||
use crate::{
|
||||
DONE_CHAR, DOWNLOAD_CHAR,
|
||||
action::{Action, BuildStepId, ResultFields, StartFields},
|
||||
download_display::{DOWNLOAD_STYLE, EXTRACT_STYLE, StyledString, style_bar},
|
||||
estimator::Estimator,
|
||||
handlers::{Handler, fetch::FetchHandler},
|
||||
handlers::Handler,
|
||||
multibar::{BarSegment, MultiBar},
|
||||
nix_path, pad_string,
|
||||
nix_path,
|
||||
};
|
||||
|
||||
static DOWNLOAD_CHAR: LazyLock<String> = LazyLock::new(|| "-".blue().bold().to_string());
|
||||
static DONE_CHAR: LazyLock<String> = LazyLock::new(|| "#".green().bold().to_string());
|
||||
const INFO_WIDTH: usize = 13;
|
||||
|
||||
pub struct SubstituteHandler;
|
||||
|
||||
impl Handler for SubstituteHandler {
|
||||
@@ -109,12 +106,9 @@ impl DownloadHandler {
|
||||
};
|
||||
let name = nix_path::extract_package_name_string(&self.path)
|
||||
.unwrap_or_else(|| "unknown".to_string());
|
||||
let name = pad_string(&name, (width / 4) as usize);
|
||||
let status = format!("Download {} |", name.purple().bold());
|
||||
let status_len = (width / 4) as usize + 10;
|
||||
|
||||
if self.download_expected == 0 || self.extract_expected == 0 {
|
||||
bar.set_message(format!("{status}"));
|
||||
bar.set_message(format!("Downloading {name}"));
|
||||
bar.tick();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user