From 4459ffe30e017516d3100b941305234c14e7f003 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 9 Jul 2020 13:25:38 +0200 Subject: [PATCH] =?UTF-8?q?src/backup/manifest.rs:=20add=20default=20to?= =?UTF-8?q?=C3=B6make=20it=20compatible=20with=20older=20backus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backup/manifest.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backup/manifest.rs b/src/backup/manifest.rs index b60582aa..d25c19b1 100644 --- a/src/backup/manifest.rs +++ b/src/backup/manifest.rs @@ -35,10 +35,14 @@ mod hex_csum { } } +fn crypt_mode_none() -> CryptMode { CryptMode::None } +fn empty_value() -> Value { json!({}) } + #[derive(Serialize, Deserialize)] #[serde(rename_all="kebab-case")] pub struct FileInfo { pub filename: String, + #[serde(default="crypt_mode_none")] // to be compatible with < 0.8.0 backups pub crypt_mode: CryptMode, pub size: u64, #[serde(with = "hex_csum")] @@ -52,6 +56,7 @@ pub struct BackupManifest { backup_id: String, backup_time: i64, files: Vec, + #[serde(default="empty_value")] // to be compatible with < 0.8.0 backups pub unprotected: Value, }