diff --git a/src/main.rs b/src/main.rs index c10155e..6d12ddd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,6 @@ +use std::fs; +use std::io; + enum Orientation { N, E, @@ -30,6 +33,11 @@ fn parse_instruction(c: char) -> Result { } } -fn main() { - let file_data = include_str!("../two_robots.txt"); +fn open_file(filename: &str) -> io::Result { + let content = fs::read_to_string(filename)?; + Ok(content) +} + +fn main() { + let conf = open_file("two_robots.txt"); }