diff --git a/src/consts.rs b/src/consts.rs index 153877f..8495fa2 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -61,6 +61,10 @@ pub(crate) const TICK_CHARS: &str = concat!( "⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿", // 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_MESSAGE: &str = "Print version number."; diff --git a/src/subcommand/torrent/create/create_content.rs b/src/subcommand/torrent/create/create_content.rs index 17cc1c3..664fda6 100644 --- a/src/subcommand/torrent/create/create_content.rs +++ b/src/subcommand/torrent/create/create_content.rs @@ -38,10 +38,7 @@ impl CreateContent { .unwrap_or_else(|| PieceLengthPicker::from_content_size(files.total_size())); let style = ProgressStyle::default_bar() - .template( - "{spinner:.green} ⟪{elapsed_precise}⟫ ⟦{bar:40.cyan}⟧ \ - {binary_bytes}/{binary_total_bytes} ⟨{binary_bytes_per_sec}, {eta}⟩", - ) + .template(consts::PROGRESS_STYLE) .tick_chars(consts::TICK_CHARS) .progress_chars(consts::PROGRESS_CHARS); diff --git a/src/subcommand/torrent/verify.rs b/src/subcommand/torrent/verify.rs index 4175f9f..f053657 100644 --- a/src/subcommand/torrent/verify.rs +++ b/src/subcommand/torrent/verify.rs @@ -54,10 +54,7 @@ impl Verify { let progress_bar = if env.err().is_styled_term() { let style = ProgressStyle::default_bar() - .template( - "{spinner:.green} ⟪{elapsed_precise}⟫ ⟦{bar:40.cyan}⟧ \ - {binary_bytes}/{binary_total_bytes} ⟨{binary_bytes_per_sec}, {eta}⟩", - ) + .template(consts::PROGRESS_STYLE) .tick_chars(consts::TICK_CHARS) .progress_chars(consts::PROGRESS_CHARS);