From 3b17341a7a8e1ecab6a28adc72c5e2b8db0f498d Mon Sep 17 00:00:00 2001 From: "Spencer C. Imbleau" Date: Sun, 10 Mar 2024 15:32:32 -0400 Subject: [PATCH] Switch from `dialoguer` to `inquire` (#512) * fix: switch to inquire * refactor: remove another line * Update Cargo.toml Co-authored-by: Kaur Kuut --------- Co-authored-by: Kaur Kuut --- examples/scenes/Cargo.toml | 2 +- examples/scenes/src/download.rs | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/scenes/Cargo.toml b/examples/scenes/Cargo.toml index 922836822..ee5a73098 100644 --- a/examples/scenes/Cargo.toml +++ b/examples/scenes/Cargo.toml @@ -21,7 +21,7 @@ instant = { workspace = true } # Used for the `download` command [target.'cfg(not(target_arch = "wasm32"))'.dependencies] byte-unit = "4.0.19" -dialoguer = "0.10.4" +inquire = "0.7.0" ureq = "2.9.6" [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/examples/scenes/src/download.rs b/examples/scenes/src/download.rs index 2a0b69ccb..86d5c32b5 100644 --- a/examples/scenes/src/download.rs +++ b/examples/scenes/src/download.rs @@ -74,10 +74,7 @@ impl Download { // For rustfmt, split prompt into its own line const PROMPT: &str = "Would you like to download a set of default svg files, as explained above?"; - accepted = dialoguer::Confirm::new() - .with_prompt(PROMPT) - .wait_for_newline(true) - .interact()?; + accepted = inquire::Confirm::new(PROMPT).with_default(false).prompt()?; } else { println!("Nothing to download! All default downloads already created"); } @@ -101,11 +98,9 @@ impl Download { let cont = if self.auto { false } else { - dialoguer::Confirm::new() - .with_prompt("Would you like to try other downloads?") - .wait_for_newline(true) - .default(false) - .interact()? + inquire::Confirm::new("Would you like to try other downloads?") + .with_default(false) + .prompt()? }; if !cont { println!("{} downloads complete", completed_count);