Skip to content

Commit 25c5a89

Browse files
committed
admin/dialoguer: Rename async_confirm() fn to confirm()
1 parent de642f8 commit 25c5a89

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

src/bin/crates-admin/delete_crate.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
5454
}
5555
println!();
5656

57-
if !opts.yes
58-
&& !dialoguer::async_confirm("Do you want to permanently delete these crates?").await?
59-
{
57+
if !opts.yes && !dialoguer::confirm("Do you want to permanently delete these crates?").await? {
6058
return Ok(());
6159
}
6260

src/bin/crates-admin/delete_version.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
5858
println!();
5959

6060
if !opts.yes
61-
&& !dialoguer::async_confirm("Do you want to permanently delete these versions?")
62-
.await?
61+
&& !dialoguer::confirm("Do you want to permanently delete these versions?").await?
6362
{
6463
return Ok(());
6564
}

src/bin/crates-admin/dialoguer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use ::dialoguer::{theme::Theme, Confirm};
22
use crates_io::tasks::spawn_blocking;
33

4-
pub async fn async_confirm(msg: impl Into<String>) -> anyhow::Result<bool> {
4+
pub async fn confirm(msg: impl Into<String>) -> anyhow::Result<bool> {
55
let msg = msg.into();
66
spawn_blocking(move || sync_confirm(msg).map_err(anyhow::Error::from)).await
77
}

src/bin/crates-admin/transfer_crates.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async fn transfer(opts: Opts, conn: &mut AsyncPgConnection) -> anyhow::Result<()
4646
println!("from: {:?}", from.gh_id);
4747
println!("to: {:?}", to.gh_id);
4848

49-
if !dialoguer::async_confirm("continue?").await? {
49+
if !dialoguer::confirm("continue?").await? {
5050
return Ok(());
5151
}
5252
}
@@ -55,7 +55,7 @@ async fn transfer(opts: Opts, conn: &mut AsyncPgConnection) -> anyhow::Result<()
5555
"Are you sure you want to transfer crates from {} to {}?",
5656
from.gh_login, to.gh_login
5757
);
58-
if !dialoguer::async_confirm(&prompt).await? {
58+
if !dialoguer::confirm(&prompt).await? {
5959
return Ok(());
6060
}
6161

@@ -80,7 +80,7 @@ async fn transfer(opts: Opts, conn: &mut AsyncPgConnection) -> anyhow::Result<()
8080
}
8181
}
8282

83-
if !dialoguer::async_confirm("commit?").await? {
83+
if !dialoguer::confirm("commit?").await? {
8484
return Ok(());
8585
}
8686

src/bin/crates-admin/upload_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
3232
})
3333
.await?;
3434

35-
if !dialoguer::async_confirm("continue with upload?").await? {
35+
if !dialoguer::confirm("continue with upload?").await? {
3636
return Ok(());
3737
}
3838

src/bin/crates-admin/yank_version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async fn yank(opts: Opts, conn: &mut AsyncPgConnection) -> anyhow::Result<()> {
5555
"Are you sure you want to yank {crate_name}#{version} ({})?",
5656
v.id
5757
);
58-
if !dialoguer::async_confirm(&prompt).await? {
58+
if !dialoguer::confirm(&prompt).await? {
5959
return Ok(());
6060
}
6161
}

0 commit comments

Comments
 (0)