init
This commit is contained in:
parent
0df924d747
commit
16cc0dc1ba
@ -1,13 +1,14 @@
|
|||||||
use Fasching::{compare_snapshots, create_snapshot, import_snapshot};
|
use Fasching::{compare_snapshots, create_snapshot, import_snapshot};
|
||||||
use Fasching::hasher::HashType::BLAKE3;
|
use Fasching::hasher::HashType::BLAKE3;
|
||||||
use Fasching::snapshot::{Snapshot, SnapshotCompareResult};
|
use Fasching::snapshot::{Snapshot, SnapshotChangeType, SnapshotCompareResult};
|
||||||
use crate::syscompare::Comparer;
|
use crate::syscompare::Comparer;
|
||||||
|
|
||||||
pub struct CompareMode {
|
pub struct CompareMode {
|
||||||
left: Snapshot,
|
left: Snapshot,
|
||||||
right: Snapshot,
|
right: Snapshot,
|
||||||
args: Vec<String>,
|
args: Vec<String>,
|
||||||
results: SnapshotCompareResult
|
result_type: SnapshotChangeType,
|
||||||
|
results: SnapshotCompareResult,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CompareMode {
|
impl CompareMode {
|
||||||
@ -21,6 +22,7 @@ impl CompareMode {
|
|||||||
left,
|
left,
|
||||||
right,
|
right,
|
||||||
args,
|
args,
|
||||||
|
result_type: SnapshotChangeType::None,
|
||||||
results: SnapshotCompareResult {
|
results: SnapshotCompareResult {
|
||||||
created: vec![],
|
created: vec![],
|
||||||
deleted: vec![],
|
deleted: vec![],
|
||||||
@ -31,8 +33,10 @@ impl CompareMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Comparer for CompareMode {
|
impl Comparer for CompareMode {
|
||||||
fn run(&self) {
|
fn run(&mut self) {
|
||||||
let results = compare_snapshots(self.left.clone(), self.right.clone()).unwrap();
|
let results = compare_snapshots(self.left.clone(), self.right.clone()).unwrap();
|
||||||
|
self.results = results.1;
|
||||||
|
self.result_type = results.0;
|
||||||
|
println!("Result: {:?}", results.1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user