xref: /Held/src/utils/term_io.rs (revision 984a200e159c143eb730a2df362731fe1a62fe01)
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 {
11     pub fn write_str<D: Display>(str: D) -> io::Result<()> {
12         stdout().execute(Print(str)).unwrap().flush()?;
13         Ok(())
14     }
15 }
16