pub fn new_from_file<P: AsRef<Path>>(path: P) -> Result<State> {
        let file = File::open(path)?;
        let buf_reader = BufReader::new(file);
        let mut state = State::empty_state();
        for line in buf_reader.lines() {
            let l = line.unwrap_or_default();
            let mut vec = Vec::new();
            for ch in l.chars() {
                vec.push(ch);
            }
            state.initial_grid.push(vec)
        }
        Ok(state)
    }
//new_from_file produces a state containing the contents of the file
new_from_file produces a state containing the contents of the file
new_from_file produces a state containing the contents of the file
pub fn new_from_file<P: AsRef<Path>>(path: P) -> Result<State> {
        let file = File::open(path)?;
        let buf_reader = BufReader::new(file);
        let mut state = State::empty_state();
        for line in buf_reader.lines() {
            let l = line.unwrap_or_default();
            let mut vec = Vec::new();
            for ch in l.chars() {
                vec.push(ch);
            }
            state.initial_grid.push(vec)
        }
        Ok(state)
    }
pub fn new_from_file < P : AsRef < Path > > ( path : P ) -> Result < State > { let file = File :: open ( path ) ? ; let buf_reader = BufReader :: new ( file ) ; let mut state = State :: empty_state ( ) ; for line in buf_reader . lines ( ) { let l = line . unwrap_or_default ( ) ; let mut vec = Vec :: new ( ) ; for ch in l . chars ( ) { vec . push ( ch ) ; } state . initial_grid . push ( vec ) } Ok ( state ) }
new_from_file produces a state containing the contents of the file
new_from_file produces a state containing the contents of the file
path
P
path
P