pub fn new(input_fname: &Path) -> Result<Scanner, Box<dyn Error>> {
        let file_contents = fs::read_to_string(input_fname)
            .map_err(|e| format!("Error reading file {}: {}", input_fname.display(), e))?;

        Ok(Scanner::new_from_string(file_contents))
    }
// Loads input file into the scanner, returns an error if it fails to read
// the said file.
// TODO: Currently the scanner loads the entire input file, perhaps
// it is possible to incremental read parts of the file into a buffer instead
// Idea: Load entire line so that we can even illustrate where errors are found
Loads input file into the scanner, returns an error if it fails to read
the said file.
TODO: Currently the scanner loads the entire input file, perhaps
it is possible to incremental read parts of the file into a buffer instead
Idea: Load entire line so that we can even illustrate where errors are found
Loads input file into the scanner returns an error if it fails to read the said file . TODO : Currently the scanner loads the entire input file perhaps it is possible to incremental read parts of the file into a buffer instead Idea : Load entire line so that we can even illustrate where errors are found
pub fn new(input_fname: &Path) -> Result<Scanner, Box<dyn Error>> {
        let file_contents = fs::read_to_string(input_fname)
            .map_err(|e| format!("Error reading file {}: {}", input_fname.display(), e))?;
        Ok(Scanner::new_from_string(file_contents))
    }
pub fn new ( input_fname : & Path ) -> Result < Scanner , Box < dyn Error > > { let file_contents = fs :: read_to_string ( input_fname ) . map_err ( | e | format ! ( " " input_fname display ( ) e ) ) ? ; Ok ( Scanner :: new_from_string ( file_contents ) ) }
Loads input file into the scanner, returns an error if it fails to read
the said file.
Loads input file into the scanner returns an error if it fails to read the said file .
input_fname
&Path