Deduplicate progress style string
type: reform
This commit is contained in:
parent
db2a2ac4f5
commit
a395052f7c
|
@ -61,6 +61,10 @@ pub(crate) const TICK_CHARS: &str = concat!(
|
||||||
"⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿", // 0b1111----
|
"⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿", // 0b1111----
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pub(crate) const PROGRESS_STYLE: &str = "{spinner:.green} ⟪{elapsed_precise}⟫ ⟦{bar:.cyan}⟧ \
|
||||||
|
{binary_bytes}/{binary_total_bytes} \
|
||||||
|
⟨{binary_bytes_per_sec}, {eta}⟩";
|
||||||
|
|
||||||
pub(crate) const VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION"));
|
pub(crate) const VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION"));
|
||||||
|
|
||||||
pub(crate) const VERSION_MESSAGE: &str = "Print version number.";
|
pub(crate) const VERSION_MESSAGE: &str = "Print version number.";
|
||||||
|
|
|
@ -38,10 +38,7 @@ impl CreateContent {
|
||||||
.unwrap_or_else(|| PieceLengthPicker::from_content_size(files.total_size()));
|
.unwrap_or_else(|| PieceLengthPicker::from_content_size(files.total_size()));
|
||||||
|
|
||||||
let style = ProgressStyle::default_bar()
|
let style = ProgressStyle::default_bar()
|
||||||
.template(
|
.template(consts::PROGRESS_STYLE)
|
||||||
"{spinner:.green} ⟪{elapsed_precise}⟫ ⟦{bar:40.cyan}⟧ \
|
|
||||||
{binary_bytes}/{binary_total_bytes} ⟨{binary_bytes_per_sec}, {eta}⟩",
|
|
||||||
)
|
|
||||||
.tick_chars(consts::TICK_CHARS)
|
.tick_chars(consts::TICK_CHARS)
|
||||||
.progress_chars(consts::PROGRESS_CHARS);
|
.progress_chars(consts::PROGRESS_CHARS);
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,7 @@ impl Verify {
|
||||||
|
|
||||||
let progress_bar = if env.err().is_styled_term() {
|
let progress_bar = if env.err().is_styled_term() {
|
||||||
let style = ProgressStyle::default_bar()
|
let style = ProgressStyle::default_bar()
|
||||||
.template(
|
.template(consts::PROGRESS_STYLE)
|
||||||
"{spinner:.green} ⟪{elapsed_precise}⟫ ⟦{bar:40.cyan}⟧ \
|
|
||||||
{binary_bytes}/{binary_total_bytes} ⟨{binary_bytes_per_sec}, {eta}⟩",
|
|
||||||
)
|
|
||||||
.tick_chars(consts::TICK_CHARS)
|
.tick_chars(consts::TICK_CHARS)
|
||||||
.progress_chars(consts::PROGRESS_CHARS);
|
.progress_chars(consts::PROGRESS_CHARS);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user