fn open(&mut self, filename: &str) -> io::Result<()> {
        self.filename = filename.to_owned();
        self.syntax = Syntax::from(filename);
        let f = File::open(filename)?;
        let handle = BufReader::new(f);
        self.rows = handle
            .lines()
            .map(|s| Ok(Row::from(s?, self.syntax)))
            .collect::<io::Result<Vec<Row>>>()?;
        Ok(())
    }
/// Open a file and load all lines into the editor
Open a file and load all lines into the editor
Open a file and load all lines into the editor
fn open(&mut self, filename: &str) -> io::Result<()> {
        self.filename = filename.to_owned();
        self.syntax = Syntax::from(filename);
        let f = File::open(filename)?;
        let handle = BufReader::new(f);
        self.rows = handle
            .lines()
            .map(|s| Ok(Row::from(s?, self.syntax)))
            .collect::<io::Result<Vec<Row>>>()?;
        Ok(())
    }
fn open ( & mut self , filename : & str ) -> io :: Result < ( ) > { self . filename = filename . to_owned ( ) ; self . syntax = Syntax :: from ( filename ) ; let f = File :: open ( filename ) ? ; let handle = BufReader :: new ( f ) ; self . rows = handle . lines ( ) . map ( | s | Ok ( Row :: from ( s ? , self . syntax ) ) ) . collect :: < io :: Result < Vec < Row > > > ( ) ? ; Ok ( ( ) ) }
Open a file and load all lines into the editor
Open a file and load all lines into the editor
&mut self
filename
&str