From 16e859c785f010cec99c443576955cb2051ce2f3 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Wed, 25 Oct 2023 01:13:36 +0800 Subject: [PATCH] feat: fix util_term --- Cargo.toml | 2 +- src/util_term.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb0e96f..f138657 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_util" -version = "0.6.44" +version = "0.6.45" authors = ["Hatter Jiang "] edition = "2018" description = "Hatter's Rust Util" diff --git a/src/util_term.rs b/src/util_term.rs index e6f8d61..79aa4b8 100644 --- a/src/util_term.rs +++ b/src/util_term.rs @@ -1,4 +1,5 @@ use std::io::{self, Write}; +use crate::print_ex; pub const RED: &str = "\x1B[91m"; pub const GREEN: &str = "\x1B[92m"; @@ -9,7 +10,7 @@ pub const END: &str = "\x1B[0m"; pub fn read_yes_no(hint: &str) -> bool { loop { - print!("{} (Yes/No): ", hint); + print_ex!("{} (Yes/No): ", hint); io::stdout().flush().ok(); let mut buff = String::new(); let _ = io::stdin().read_line(&mut buff).expect("Read line from stdin");