From 015a8a33aee6d42f3e219a5db9a4932f76dd7cac Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Mon, 19 Oct 2020 12:50:48 +0200 Subject: [PATCH] error handling in main --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5bfd178..c4a4c3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,9 +64,10 @@ fn open_file(filename: &str) -> io::Result { Ok(content) } -fn main() { +fn main() -> Result<(), Box> { let mut robot_pool: Vec = Vec::new(); - let raw_conf = open_file("two_robots.txt"); + let raw_conf = open_file("two_robots.txt")?; + Ok(()) } #[cfg(test)]