[][src]Function filehash_rs::filehash

pub fn filehash(file_path: &mut String) -> Result<u64, Error>
// A simple example of a program that queries the user
// for a file to hash and prints the result.
fn main() -> Result<(), Box<dyn Error>> {
   let mut input_string = String::new();
   println!("Path to the file:");

   std::io::stdin().read_line(&mut input_string)?;

   let result = filehash(&mut input_string);

   match result {
       Ok(value) => {
           println!("{}", value);
           return Ok(());
       }
       Err(err) => {
           println!("Error: {}", err);
           return Err(Box::new(err));
       }
   }
}