diff --git a/Cargo.lock b/Cargo.lock index 48886636d6d7c2..5a7f2c47cb1b35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2165,14 +2165,13 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "fcc42b206e70d86ec03285b123e65a5458c92027d1fb2ae3555878b8113b3ddf" dependencies = [ "console", - "lazy_static", "number_prefix", - "regex", + "unicode-width", ] [[package]] diff --git a/cli-output/Cargo.toml b/cli-output/Cargo.toml index 88adddaa1a47dd..8fffad8eb4f3f8 100644 --- a/cli-output/Cargo.toml +++ b/cli-output/Cargo.toml @@ -16,7 +16,7 @@ chrono = { version = "0.4.11", features = ["serde"] } clap = "2.33.0" console = "0.15.0" humantime = "2.0.1" -indicatif = "0.16.2" +indicatif = "0.17.0" pretty-hex = "0.3.0" semver = "1.0.10" serde = "1.0.138" diff --git a/cli-output/src/display.rs b/cli-output/src/display.rs index da4ef31bd28dbb..720a3f161d77fb 100644 --- a/cli-output/src/display.rs +++ b/cli-output/src/display.rs @@ -19,7 +19,7 @@ use { }, solana_transaction_status::{Rewards, UiTransactionStatusMeta}, spl_memo::{id as spl_memo_id, v1::id as spl_memo_v1_id}, - std::{collections::HashMap, fmt, io}, + std::{collections::HashMap, fmt, io, time::Duration}, }; #[derive(Clone, Debug)] @@ -684,9 +684,12 @@ pub fn writeln_transaction( /// Creates a new process bar for processing that will take an unknown amount of time pub fn new_spinner_progress_bar() -> ProgressBar { let progress_bar = ProgressBar::new(42); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); progress_bar } diff --git a/client/Cargo.toml b/client/Cargo.toml index 90ffb7ffa6f490..a7a0eaf2b45996 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -22,7 +22,7 @@ enum_dispatch = "0.3.8" futures = "0.3" futures-util = "0.3.21" indexmap = "1.9.1" -indicatif = "0.16.2" +indicatif = "0.17.0" itertools = "0.10.2" jsonrpc-core = "18.0.0" lazy_static = "1.4.0" diff --git a/client/src/spinner.rs b/client/src/spinner.rs index 19b788b4a52e7b..177ae3d7894452 100644 --- a/client/src/spinner.rs +++ b/client/src/spinner.rs @@ -1,12 +1,18 @@ //! Spinner creator -use indicatif::{ProgressBar, ProgressStyle}; +use { + indicatif::{ProgressBar, ProgressStyle}, + std::time::Duration, +}; pub(crate) fn new_progress_bar() -> ProgressBar { let progress_bar = ProgressBar::new(42); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); progress_bar } diff --git a/download-utils/Cargo.toml b/download-utils/Cargo.toml index be1af0277aba6b..e0dce0dfdc1392 100644 --- a/download-utils/Cargo.toml +++ b/download-utils/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" [dependencies] console = "0.15.0" -indicatif = "0.16.2" +indicatif = "0.17.0" log = "0.4.17" reqwest = { version = "0.11.11", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } solana-runtime = { path = "../runtime", version = "=1.11.6" } diff --git a/download-utils/src/lib.rs b/download-utils/src/lib.rs index f607e42e512848..87187009833da0 100644 --- a/download-utils/src/lib.rs +++ b/download-utils/src/lib.rs @@ -23,9 +23,12 @@ static SPARKLE: Emoji = Emoji("✨ ", ""); /// Creates a new process bar for processing that will take an unknown amount of time fn new_spinner_progress_bar() -> ProgressBar { let progress_bar = ProgressBar::new(42); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); progress_bar } @@ -112,6 +115,7 @@ pub fn download_file<'a, 'b>( .template( "{spinner:.green}{msg_wide}[{bar:40.cyan/blue}] {bytes}/{total_bytes} ({eta})", ) + .expect("ProgresStyle::template direct input to be correct") .progress_chars("=> "), ); progress_bar.set_message(format!("{}Downloading~ {}", TRUCK, url)); diff --git a/install/Cargo.toml b/install/Cargo.toml index 6734dca7384cf5..4c765a43050476 100644 --- a/install/Cargo.toml +++ b/install/Cargo.toml @@ -19,7 +19,7 @@ console = "0.15.0" crossbeam-channel = "0.5" ctrlc = { version = "3.2.2", features = ["termination"] } dirs-next = "2.0.0" -indicatif = "0.16.2" +indicatif = "0.17.0" lazy_static = "1.4.0" nix = "0.24.2" reqwest = { version = "0.11.11", default-features = false, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } diff --git a/install/src/command.rs b/install/src/command.rs index 13ec7c6b47e282..c3ddd601e951b4 100644 --- a/install/src/command.rs +++ b/install/src/command.rs @@ -47,9 +47,12 @@ static RECYCLING: Emoji = Emoji("♻️ ", ""); /// Creates a new process bar for processing that will take an unknown amount of time fn new_spinner_progress_bar() -> ProgressBar { let progress_bar = ProgressBar::new(42); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); progress_bar } @@ -115,6 +118,7 @@ fn download_to_temp( .template( "{spinner:.green}{wide_msg} [{bar:40.cyan/blue}] {bytes}/{total_bytes} ({eta})", ) + .expect("ProgresStyle::template direct input to be correct") .progress_chars("=> "), ); progress_bar.set_message(format!("{}Downloading", TRUCK)); @@ -831,6 +835,7 @@ pub fn gc(config_file: &str) -> Result<(), String> { progress_bar.set_style( ProgressStyle::default_bar() .template("{spinner:.green}{wide_msg} [{bar:40.cyan/blue}] {pos}/{len} ({eta})") + .expect("ProgresStyle::template direct input to be correct") .progress_chars("=> "), ); progress_bar.set_message(format!("{}Removing old releases", RECYCLING)); diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 712370bcbd0e9d..df457f7280ac70 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -1912,14 +1912,13 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "fcc42b206e70d86ec03285b123e65a5458c92027d1fb2ae3555878b8113b3ddf" dependencies = [ "console", - "lazy_static", "number_prefix", - "regex", + "unicode-width", ] [[package]] diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 90d43d54ec7082..cbc1fbd5499423 100644 --- a/tokens/Cargo.toml +++ b/tokens/Cargo.toml @@ -16,7 +16,7 @@ console = "0.15.0" csv = "1.1.6" ctrlc = { version = "3.2.2", features = ["termination"] } indexmap = "1.9.1" -indicatif = "0.16.2" +indicatif = "0.17.0" pickledb = "0.4.1" serde = { version = "1.0", features = ["derive"] } solana-account-decoder = { path = "../account-decoder", version = "=1.11.6" } diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index ec23b0bab9183a..f7ce05aa47f976 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -528,9 +528,12 @@ fn read_allocations( fn new_spinner_progress_bar() -> ProgressBar { let progress_bar = ProgressBar::new(42); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); progress_bar } diff --git a/validator/Cargo.toml b/validator/Cargo.toml index ddbe83c0f6d9ce..aaed33a697662a 100644 --- a/validator/Cargo.toml +++ b/validator/Cargo.toml @@ -17,7 +17,7 @@ console = "0.15.0" core_affinity = "0.5.10" crossbeam-channel = "0.5" fd-lock = "3.0.5" -indicatif = "0.16.2" +indicatif = "0.17.0" jsonrpc-core = "18.0.0" jsonrpc-core-client = { version = "18.0.0", features = ["ipc"] } jsonrpc-derive = "18.0.0" diff --git a/validator/src/lib.rs b/validator/src/lib.rs index ba1efd3f44ca14..fa40f4dfb0ae4d 100644 --- a/validator/src/lib.rs +++ b/validator/src/lib.rs @@ -14,6 +14,7 @@ use { path::Path, process::exit, thread::JoinHandle, + time::Duration, }, }; @@ -121,9 +122,12 @@ pub fn println_name_value(name: &str, value: &str) { pub fn new_spinner_progress_bar() -> ProgressBar { let progress_bar = indicatif::ProgressBar::new(42); progress_bar.set_draw_target(ProgressDrawTarget::stdout()); - progress_bar - .set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}")); - progress_bar.enable_steady_tick(100); + progress_bar.set_style( + ProgressStyle::default_spinner() + .template("{spinner:.green} {wide_msg}") + .expect("ProgresStyle::template direct input to be correct"), + ); + progress_bar.enable_steady_tick(Duration::from_millis(100)); ProgressBar { progress_bar,