From 3e1cb020d5449849b37874f91cadfa4a9c878747 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Fri, 6 Sep 2024 10:56:30 +0200 Subject: initial commit, can save index, no modification check --- src/storage.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/storage.rs (limited to 'src/storage.rs') diff --git a/src/storage.rs b/src/storage.rs new file mode 100644 index 0000000..b9e8de9 --- /dev/null +++ b/src/storage.rs @@ -0,0 +1,8 @@ +use std::{fs::File, io::Write}; + +use crate::backup::Backup; + +pub fn save_index(backup: Backup) { + let mut f = File::create("./index.json").unwrap(); + f.write_all(&serde_json::to_vec(&backup).unwrap()).unwrap(); +} -- cgit v1.2.3