Skip to content

Commit 3ff02cd

Browse files
committed
Fix confirm
1 parent 6c2ef1d commit 3ff02cd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/utils.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ use std::cmp::min;
1010
use std::fs::File;
1111
use std::io;
1212
use std::io::prelude::*;
13+
use std::io::{stdout, Seek, Write};
14+
use std::iter::Iterator;
1315
use std::path::Path;
1416
use url::Url;
15-
use zip::ZipArchive;
16-
17-
use std::io::{Seek, Write};
18-
use std::iter::Iterator;
1917
use zip::write::FileOptions;
18+
use zip::ZipArchive;
2019

2120
use walkdir::DirEntry;
2221

@@ -47,9 +46,9 @@ pub fn get_mmrl_json(path: &str) -> Result<MMRLJSON, serde_json::Error> {
4746

4847
pub fn confirm(msg: &str) -> bool {
4948
loop {
50-
println!("{}", msg);
49+
print!("{}", msg);
5150
let mut input = String::new();
52-
51+
io::stdout().flush().unwrap();
5352
io::stdin()
5453
.read_line(&mut input)
5554
.expect("Failed to read input");

0 commit comments

Comments
 (0)