lib.rs (281B)
1 pub mod utils { 2 pub fn read_buffer() -> Result<String, Box<dyn std::error::Error>> { 3 let mut buffer = String::new(); 4 std::io::stdin() 5 .read_line(&mut buffer) 6 .expect("Failed to read line."); 7 Ok(buffer.trim().to_string()) 8 } 9 }