fn read_file(filepath: &Path) -> Result<(String, String)> {
    log::info!("Reading {}", filepath.display().to_string());

    let buf = fs::read(filepath).unwrap();
    let contents = String::from_utf8_lossy(&buf).into_owned().to_string();
    let mut hasher = Sha3_512::new();
    hasher.update(&buf);
    let hash = hasher.finalize();

    Ok((contents.to_owned(), format!("{:x}", hash).to_owned()))
}
/*
    Reads a file and returns a FileContents struct containing:
        - contents: String containing all file contents but replacing non UTF8 chars
        - hash: Hash of the file
*/
Reads a file and returns a FileContents struct containing:
contents: String containing all file contents but replacing non UTF8 chars
hash: Hash of the file
Reads a file and returns a FileContents struct containing : contents : String containing all file contents but replacing non UTF8 chars hash : Hash of the file
fn read_file(filepath: &Path) -> Result<(String, String)> {
    log::info!("Reading {}", filepath.display().to_string());
    let buf = fs::read(filepath).unwrap();
    let contents = String::from_utf8_lossy(&buf).into_owned().to_string();
    let mut hasher = Sha3_512::new();
    hasher.update(&buf);
    let hash = hasher.finalize();
    Ok((contents.to_owned(), format!("{:x}", hash).to_owned()))
}
fn read_file ( filepath : & Path ) -> Result < ( String , String ) > { log :: info ! ( " " filepath display ( ) to_string ( ) ) ; let buf = fs :: read ( filepath ) . unwrap ( ) ; let contents = String :: from_utf8_lossy ( & buf ) . into_owned ( ) . to_string ( ) ; let mut hasher = Sha3_512 :: new ( ) ; hasher . update ( & buf ) ; let hash = hasher . finalize ( ) ; Ok ( ( contents . to_owned ( ) , format ! ( " " hash ) . to_owned ( ) ) ) }
Reads a file and returns a FileContents struct containing:
 contents: String containing all file contents but replacing non UTF8 chars
 hash: Hash of the file
Reads a file and returns a FileContents struct containing : contents : String containing all file contents but replacing non UTF8 chars hash : Hash of the file
filepath
&Path
filepath
&Path