Bump indicatif from 0.15.0 to 0.16.2 (#17628)

* Bump indicatif from 0.15.0 to 0.16.2

Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.15.0 to 0.16.2.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/compare/0.15.0...0.16.2)

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* Fix message types

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
dependabot[bot]
2021-06-01 17:38:02 +00:00
committed by GitHub
parent a0d721c6bd
commit a43c29e858
18 changed files with 52 additions and 56 deletions

View File

@ -18,7 +18,7 @@ clap = "2.33.1"
console = "0.14.1"
core_affinity = "0.5.10"
fd-lock = "2.0.0"
indicatif = "0.15.0"
indicatif = "0.16.2"
jsonrpc-core = "17.0.0"
jsonrpc-core-client = { version = "17.0.0", features = ["ipc", "ws"] }
jsonrpc-derive = "17.0.0"

View File

@ -143,7 +143,7 @@ impl Dashboard {
)
};
progress_bar.set_message(&format!(
progress_bar.set_message(format!(
"{}{}{}| \
Processed Slot: {} | Confirmed Slot: {} | Finalized Slot: {} | \
Snapshot Slot: {} | \
@ -172,7 +172,7 @@ impl Dashboard {
}
Err(err) => {
progress_bar
.abandon_with_message(&format!("RPC connection failure: {}", err));
.abandon_with_message(format!("RPC connection failure: {}", err));
break;
}
}
@ -197,7 +197,7 @@ async fn wait_for_validator_startup(
match admin_rpc_service::connect(&ledger_path).await {
Ok(new_admin_client) => admin_client = Some(new_admin_client),
Err(err) => {
progress_bar.set_message(&format!("Unable to connect to validator: {}", err));
progress_bar.set_message(format!("Unable to connect to validator: {}", err));
thread::sleep(refresh_interval);
continue;
}
@ -216,22 +216,21 @@ async fn wait_for_validator_startup(
}
.await
{
Ok((None, _)) => progress_bar.set_message(&"RPC service not available"),
Ok((None, _)) => progress_bar.set_message("RPC service not available"),
Ok((Some(rpc_addr), start_time)) => return Some((rpc_addr, start_time)),
Err(err) => {
progress_bar
.set_message(&format!("Failed to get validator info: {}", err));
.set_message(format!("Failed to get validator info: {}", err));
}
}
} else {
progress_bar
.set_message(&format!("Validator startup: {:?}...", start_progress));
progress_bar.set_message(format!("Validator startup: {:?}...", start_progress));
}
}
Err(err) => {
admin_client = None;
progress_bar
.set_message(&format!("Failed to get validator start progress: {}", err));
.set_message(format!("Failed to get validator start progress: {}", err));
}
}
thread::sleep(refresh_interval);

View File

@ -5,7 +5,7 @@ use {
console::style,
indicatif::{ProgressDrawTarget, ProgressStyle},
log::*,
std::{env, process::exit, thread::JoinHandle},
std::{borrow::Cow, env, fmt::Display, process::exit, thread::JoinHandle},
};
pub mod admin_rpc_service;
@ -117,7 +117,7 @@ pub struct ProgressBar {
}
impl ProgressBar {
pub fn set_message(&self, msg: &str) {
pub fn set_message<T: Into<Cow<'static, str>> + Display>(&self, msg: T) {
if self.is_term {
self.progress_bar.set_message(msg);
} else {
@ -125,7 +125,7 @@ impl ProgressBar {
}
}
pub fn abandon_with_message(&self, msg: &str) {
pub fn abandon_with_message<T: Into<Cow<'static, str>> + Display>(&self, msg: T) {
if self.is_term {
self.progress_bar.abandon_with_message(msg);
} else {

View File

@ -160,7 +160,7 @@ fn wait_for_restart_window(
None => true,
Some(current_epoch) => current_epoch != epoch_info.epoch,
} {
progress_bar.set_message(&format!(
progress_bar.set_message(format!(
"Fetching leader schedule for epoch {}...",
epoch_info.epoch
));
@ -285,7 +285,7 @@ fn wait_for_restart_window(
}
};
progress_bar.set_message(&format!(
progress_bar.set_message(format!(
"{} | Processed Slot: {} | Snapshot Slot: {} | {:.2}% delinquent stake | {}",
{
let elapsed =