fn read_first_line<P>(filename: P) -> std::result::Result<String, std::io::Error>
    where
        P: AsRef<Path>,
    {
        let file = File::open(filename)?;
        let mut reader = BufReader::new(file);
        let mut buf = String::new();
        reader.read_line(&mut buf)?;

        Ok(buf)
    }
// Utility function to read the first line in a file
Utility function to read the first line in a file
Utility function to read the first line in a file
fn read_first_line<P>(filename: P) -> std::result::Result<String, std::io::Error>
    where
        P: AsRef<Path>,
    {
        let file = File::open(filename)?;
        let mut reader = BufReader::new(file);
        let mut buf = String::new();
        reader.read_line(&mut buf)?;
        Ok(buf)
    }
fn read_first_line < P > ( filename : P ) -> std :: result :: Result < String , std :: io :: Error > where P : AsRef < Path > , { let file = File :: open ( filename ) ? ; let mut reader = BufReader :: new ( file ) ; let mut buf = String :: new ( ) ; reader . read_line ( & mut buf ) ? ; Ok ( buf ) }
Utility function to read the first line in a file
Utility function to read the first line in a file
filename
P
filename
P