use std::{error::Error, io::stdin, str::FromStr}; #[cfg(test)] mod tests; use types::{matrix::Matrix, matrix_err::ParseMatrixError}; mod types; fn handle_input() -> Result { let input = stdin(); let mut construct_string = String::from(""); loop { let mut s = "".to_string(); let _ = input.read_line(&mut s); if s == "exit\n" { break; } construct_string += &s; } Matrix::from_str(construct_string.trim_end()) } fn main() -> Result<(), Box> { let m = handle_input()?; Ok(println!("The matrix is:\n{}", m)) }