summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-07-14 05:04:04 +0200
committerCyborus <cyborus@cyborus.xyz>2024-07-14 05:04:04 +0200
commit45ad1d81b9140ec1add3c9d65d6b8b5c11a8dcb5 (patch)
tree3d4971442f168c7df42ab7c8e58cacedb8c7085d
parentMerge pull request 'prioritize remote tracking branch in repo detection' (#91... (diff)
downloadforgejo-cli-45ad1d81b9140ec1add3c9d65d6b8b5c11a8dcb5.tar.xz
forgejo-cli-45ad1d81b9140ec1add3c9d65d6b8b5c11a8dcb5.zip
fix: print message before reading in `readline`
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e330f53..59a70da 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -136,8 +136,9 @@ async fn update_msg(check: bool) -> eyre::Result<()> {
}
async fn readline(msg: &str) -> eyre::Result<String> {
+ use std::io::Write;
print!("{msg}");
- tokio::io::stdout().flush().await?;
+ std::io::stdout().flush()?;
tokio::task::spawn_blocking(|| {
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;