pub fn check_file_hash(path: &Path, expected_sha256_hex: &str) -> FileDownloadResult<()> {
    let computed_sha256_hex = compute_sha256_hex(path)?;

    if computed_sha256_hex != expected_sha256_hex {
        Err(FileDownloadError::file_hash_mismatch_error(
            computed_sha256_hex,
            expected_sha256_hex.into(),
            path.to_path_buf(),
        ))
    } else {
        Ok(())
    }
}
/// Assert that the given file has the given hash
Assert that the given file has the given hash
Assert that the given file has the given hash
pub fn check_file_hash(path: &Path, expected_sha256_hex: &str) -> FileDownloadResult<()> {
    let computed_sha256_hex = compute_sha256_hex(path)?;
    if computed_sha256_hex != expected_sha256_hex {
        Err(FileDownloadError::file_hash_mismatch_error(
            computed_sha256_hex,
            expected_sha256_hex.into(),
            path.to_path_buf(),
        ))
    } else {
        Ok(())
    }
}
pub fn check_file_hash ( path : & Path , expected_sha256_hex : & str ) -> FileDownloadResult < ( ) > { let computed_sha256_hex = compute_sha256_hex ( path ) ? ; if computed_sha256_hex != expected_sha256_hex { Err ( FileDownloadError :: file_hash_mismatch_error ( computed_sha256_hex , expected_sha256_hex . into ( ) , path . to_path_buf ( ) , ) ) } else { Ok ( ( ) ) } }
Assert that the given file has the given hash
Assert that the given file has the given hash
path
&Path
expected_sha256_hex
&str
path
&Path
expected_sha256_hex
&str