diff options
author | fxqnlr <[email protected]> | 2024-09-06 10:56:30 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-06 10:56:30 +0200 |
commit | 3e1cb020d5449849b37874f91cadfa4a9c878747 (patch) | |
tree | c5503a137c77ac33c1e7ddfd4087cc994b51a43b /src/storage.rs | |
download | arbs-3e1cb020d5449849b37874f91cadfa4a9c878747.tar arbs-3e1cb020d5449849b37874f91cadfa4a9c878747.tar.gz arbs-3e1cb020d5449849b37874f91cadfa4a9c878747.zip |
initial commit, can save index, no modification check
Diffstat (limited to 'src/storage.rs')
-rw-r--r-- | src/storage.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ | |||
1 | use std::{fs::File, io::Write}; | ||
2 | |||
3 | use crate::backup::Backup; | ||
4 | |||
5 | pub fn save_index(backup: Backup) { | ||
6 | let mut f = File::create("./index.json").unwrap(); | ||
7 | f.write_all(&serde_json::to_vec(&backup).unwrap()).unwrap(); | ||
8 | } | ||