diff-trees 0.1.3

Diff two directory trees based on their content
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::Path;

use crate::Result;
use crate::error::HashError;

pub(crate) fn hash_file(path: impl AsRef<Path>) -> Result<blake3::Hash> {
    let path = path.as_ref();
    tracing::trace!("Hashing {path:?}");
    Ok(blake3::Hasher::new()
        .update_mmap(path)
        .map_err(|inner| HashError {
            path: path.to_owned(),
            inner,
        })?
        .finalize())
}