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