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

add clear_lastline

This commit is contained in:
2019-08-03 17:10:34 +08:00
parent f8dab07f6c
commit 1fe9483cee

View File

@@ -167,6 +167,10 @@ pub fn flush_stdout() {
}
}
pub fn clear_lastline() {
print_lastline("");
}
pub fn print_lastline(line: &str) {
print!("\x1b[1000D{}\x1b[K", line);
flush_stdout();