Skip to content

Commit aa4f43c

Browse files
committed
Update dialoguer
Signed-off-by: Ryan Levick <[email protected]>
1 parent 743ac8f commit aa4f43c

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

Cargo.lock

Lines changed: 3 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ clearscreen = "3"
2424
comfy-table = "7"
2525
command-group = "2"
2626
ctrlc = { version = "3.4", features = ["termination"] }
27-
dialoguer = "0.10"
27+
dialoguer = "0.11"
2828
dirs = { workspace = true }
2929
futures = { workspace = true }
3030
glob = { workspace = true }

crates/templates/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ anyhow = { workspace = true }
99
async-trait = { workspace = true }
1010
bytes = { workspace = true }
1111
console = "0.15"
12-
dialoguer = "0.10"
12+
dialoguer = "0.11"
1313
dirs = { workspace = true }
1414
fs_extra = "1"
1515
heck = "0.5"

crates/templates/src/interaction.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl InteractionStrategy for Interactive {
4848
match crate::interaction::confirm(&prompt) {
4949
Ok(true) => Cancellable::Ok(()),
5050
Ok(false) => Cancellable::Cancelled,
51-
Err(e) => Cancellable::Err(anyhow::Error::from(e)),
51+
Err(e) => Cancellable::Err(e.into()),
5252
}
5353
} else {
5454
Cancellable::Ok(())
@@ -101,7 +101,7 @@ impl InteractionStrategy for Silent {
101101
}
102102
}
103103

104-
pub(crate) fn confirm(text: &str) -> std::io::Result<bool> {
104+
pub(crate) fn confirm(text: &str) -> dialoguer::Result<bool> {
105105
Confirm::new().with_prompt(text).interact()
106106
}
107107

@@ -130,9 +130,9 @@ pub(crate) fn prompt_parameter(parameter: &TemplateParameter) -> Option<String>
130130

131131
fn ask_free_text(prompt: &str, default_value: &Option<String>) -> anyhow::Result<String> {
132132
let mut input = Input::<String>::new();
133-
input.with_prompt(prompt);
133+
input = input.with_prompt(prompt);
134134
if let Some(s) = default_value {
135-
input.default(s.to_owned());
135+
input = input.default(s.to_owned());
136136
}
137137
let result = input.interact_text()?;
138138
Ok(result)

0 commit comments

Comments
 (0)