error handling in main

This commit is contained in:
Volodymyr Patuta 2020-10-19 12:50:48 +02:00
parent ec01c0c1d4
commit 015a8a33ae
1 changed files with 3 additions and 2 deletions

View File

@ -64,9 +64,10 @@ fn open_file(filename: &str) -> io::Result<String> {
Ok(content) Ok(content)
} }
fn main() { fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut robot_pool: Vec<Robot> = Vec::new(); let mut robot_pool: Vec<Robot> = Vec::new();
let raw_conf = open_file("two_robots.txt"); let raw_conf = open_file("two_robots.txt")?;
Ok(())
} }
#[cfg(test)] #[cfg(test)]