diff options
author | Cyborus <cyborus@noreply.codeberg.org> | 2024-07-14 05:08:35 +0200 |
---|---|---|
committer | Cyborus <cyborus@noreply.codeberg.org> | 2024-07-14 05:08:35 +0200 |
commit | 4a9c9b7301cede81878c138f0af4ac4c66055878 (patch) | |
tree | 3d4971442f168c7df42ab7c8e58cacedb8c7085d | |
parent | Merge pull request 'prioritize remote tracking branch in repo detection' (#91... (diff) | |
parent | fix: print message before reading in `readline` (diff) | |
download | forgejo-cli-4a9c9b7301cede81878c138f0af4ac4c66055878.tar.xz forgejo-cli-4a9c9b7301cede81878c138f0af4ac4c66055878.zip |
Merge pull request 'print message before reading in `readline`' (#92) from readline-fix into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/92
-rw-r--r-- | src/main.rs | 3 |
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)?; |