1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

feat: fix util_term

This commit is contained in:
2023-10-25 01:15:28 +08:00
parent 16e859c785
commit c56b7deaaf

View File

@@ -1,5 +1,6 @@
use std::io::{self, Write}; use std::io::{self, Write};
use crate::print_ex;
use crate::util_msg;
pub const RED: &str = "\x1B[91m"; pub const RED: &str = "\x1B[91m";
pub const GREEN: &str = "\x1B[92m"; pub const GREEN: &str = "\x1B[92m";
@@ -10,7 +11,7 @@ pub const END: &str = "\x1B[0m";
pub fn read_yes_no(hint: &str) -> bool { pub fn read_yes_no(hint: &str) -> bool {
loop { loop {
print_ex!("{} (Yes/No): ", hint); util_msg::print_ex(&format!("{} (Yes/No): ", hint), false);
io::stdout().flush().ok(); io::stdout().flush().ok();
let mut buff = String::new(); let mut buff = String::new();
let _ = io::stdin().read_line(&mut buff).expect("Read line from stdin"); let _ = io::stdin().read_line(&mut buff).expect("Read line from stdin");