1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#![allow(non_snake_case)]
extern crate core;

use crate::hasher::HashType;
use crate::snapshot::{
    compare, export, import, Snapshot, SnapshotChangeType, SnapshotCompareResult,
};
use anyhow::Error;
use std::path::Path;
pub mod hasher;
pub mod snapshot;

pub fn create_snapshot(
    path: &str,
    hash_type: HashType,
    black_list: Vec<String>,
) -> Result<Snapshot, Error> {
    Snapshot::new(Path::new(path), hash_type, black_list)
}

pub fn compare_snapshots(
    left: Snapshot,
    right: Snapshot,
) -> Option<(SnapshotChangeType, SnapshotCompareResult)> {
    compare(left, right)
}

pub fn export_snapshot(snapshot: Snapshot, path: String, overwrite: bool) -> Result<(), Error> {
    export(snapshot, path, overwrite)
}

pub fn import_snapshot(path: String) -> Result<Snapshot, Error> {
    import(path)
}

// #[cfg(test)]
// mod tests {
//     use super::*;
//
//     #[test]
//     fn it_works() {
//         let result = add(2, 2);
//         assert_eq!(result, 4);
//     }
// }