mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-27 07:30:05 +08:00
feat: fix util_term
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::io::{self, Write};
|
||||
use crate::print_ex;
|
||||
|
||||
use crate::util_msg;
|
||||
|
||||
pub const RED: &str = "\x1B[91m";
|
||||
pub const GREEN: &str = "\x1B[92m";
|
||||
@@ -10,7 +11,7 @@ pub const END: &str = "\x1B[0m";
|
||||
|
||||
pub fn read_yes_no(hint: &str) -> bool {
|
||||
loop {
|
||||
print_ex!("{} (Yes/No): ", hint);
|
||||
util_msg::print_ex(&format!("{} (Yes/No): ", hint), false);
|
||||
io::stdout().flush().ok();
|
||||
let mut buff = String::new();
|
||||
let _ = io::stdin().read_line(&mut buff).expect("Read line from stdin");
|
||||
|
||||
Reference in New Issue
Block a user