From 11432ba2c381b07bb540f7f92664b3c351e3cf62 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 28 Aug 2023 14:21:47 +0300 Subject: [PATCH] melib/jmap: make `null` fields into Option<_>s Signed-off-by: Manos Pitsidianakis --- melib/src/jmap/objects/email/import.rs | 4 ++-- melib/src/jmap/rfc8620.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/melib/src/jmap/objects/email/import.rs b/melib/src/jmap/objects/email/import.rs index 1d66bd42..a540a385 100644 --- a/melib/src/jmap/objects/email/import.rs +++ b/melib/src/jmap/objects/email/import.rs @@ -186,13 +186,13 @@ pub struct ImportResponse { /// A map of the creation id to an object containing the `id`, /// `blobId`, `threadId`, and `size` properties for each successfully /// imported Email, or null if none. - pub created: IndexMap, ImportEmailResult>, + pub created: Option, ImportEmailResult>>, /// o notCreated: `Id[SetError]|null` /// A map of the creation id to a SetError object for each Email that /// failed to be created, or null if all successful. The possible /// errors are defined above. - pub not_created: IndexMap, ImportError>, + pub not_created: Option, ImportError>>, } impl std::convert::TryFrom<&RawValue> for ImportResponse { diff --git a/melib/src/jmap/rfc8620.rs b/melib/src/jmap/rfc8620.rs index f5bacaac..bcf4eb90 100644 --- a/melib/src/jmap/rfc8620.rs +++ b/melib/src/jmap/rfc8620.rs @@ -852,7 +852,7 @@ pub struct SetResponse { /// The state string that would have been returned by `Foo/get` before /// making the requested changes, or null if the server doesn't know /// what the previous state string was. - pub old_state: State, + pub old_state: Option>, /// o newState: `String` /// /// The state string that will now be returned by `Foo/get`.