From 413f94a5eb43a03a73dc3f079c334877a136190b Mon Sep 17 00:00:00 2001 From: ad4mx Date: Fri, 29 Jul 2022 12:29:47 +0200 Subject: [PATCH] changed spinner stop --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/operations/info.rs | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a71351b..1f2cad4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -485,9 +485,9 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "spinoff" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3f754b5a185a81fa60acbd32f095411e276743d27307a531d34eae5d49c991" +checksum = "01e1a863da0489c765f2642597c8d367a0a3939184b4775306d7fffdb455d952" dependencies = [ "maplit", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 8582322..010b78f 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ colored = { version = "2.0.0", default-features = false } tabled = { version = "0.8.0", default-features = false, features = ["derive", "color"] } crossterm = { version = "0.24.0", default-features = false } regex = { version = "1.6.0", default-features = false, features = ["std"] } -spinoff = { version = "0.4.0", default-features = false } +spinoff = { version = "0.5.0", default-features = false } rm_rf = { version = "0.6.2", default-features = false } [target.'cfg(target_os = "linux")'.dependencies] diff --git a/src/operations/info.rs b/src/operations/info.rs index 9e7658a..e476938 100644 --- a/src/operations/info.rs +++ b/src/operations/info.rs @@ -161,14 +161,8 @@ pub fn info(verbose: bool) { .output() .unwrap(); - // Because spinoff requires &'static str, we need to Box these in the heap and then leak them to be able to format the spinner - let symbol = Box::new(format!("{}", "✔".bold().green())); - let done = Box::new(format!("{}", "Done!".bold())); - - let symbol: &'static str = Box::leak(symbol); - let done: &'static str = Box::leak(done); - - sp.stop_and_persist(symbol, done); + // Stop the spinner with a success message + sp.success("Done!"); log!(verbose, "Repos: {:?}", repos); }