From d7670116f4f3437aff1dbb1411d9709acb55667d Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Tue, 29 Nov 2022 12:45:44 +0100 Subject: [PATCH] Fix deserialization error on missing file retention --- src/file.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.rs b/src/file.rs index 3f85344..974e916 100644 --- a/src/file.rs +++ b/src/file.rs @@ -271,7 +271,7 @@ impl FileRetentionSetting { pub struct FileRetention { #[serde(rename = "isClientAuthorizedToRead")] can_read: bool, - value: FileRetentionSetting, + value: Option, } impl FileRetention { @@ -280,7 +280,7 @@ impl FileRetention { /// If not authorized to read the settings, returns `None`. pub fn settings(&self) -> Option { if self.can_read { - Some(self.value) + self.value } else { None }