xref: /Held/src/utils/term_io.rs (revision 5dacf00fa267a9ac7a4794894f9162d71b69c2b8)
1 use std::{
2     fmt::Display,
3     io::{self, stdout, Write},
4 };
5 
6 use crossterm::{style::Print, ExecutableCommand};
7 
8 pub struct TermIO;
9 
10 impl TermIO {
write_str<D: Display>(str: D) -> io::Result<()>11     pub fn write_str<D: Display>(str: D) -> io::Result<()> {
12         stdout().execute(Print(str)).unwrap().flush()?;
13         Ok(())
14     }
15 }
16