Better handling of invalid properties.
parent
be63232d4c
commit
c8d672057e
|
@ -1,3 +1,8 @@
|
|||
jmap-client 0.3.0
|
||||
================================
|
||||
- Set timeouts using `Duration` instead of `u64`.
|
||||
- SetError handling of unknown properties.
|
||||
|
||||
jmap-client 0.2.1
|
||||
================================
|
||||
- Using maybe_async to reduce duplicate code.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "jmap-client"
|
||||
description = "JMAP client library for Rust"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = [ "Stalwart Labs Ltd. <hello@stalw.art>"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
|
|
@ -323,6 +323,7 @@ pub enum Property {
|
|||
HasAttachment,
|
||||
Preview,
|
||||
Header(Header),
|
||||
Other(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
@ -386,7 +387,7 @@ impl Property {
|
|||
"attachments" => Some(Property::Attachments),
|
||||
"bodyStructure" => Some(Property::BodyStructure),
|
||||
_ if value.starts_with("header:") => Some(Property::Header(Header::parse(value)?)),
|
||||
_ => None,
|
||||
_ => Some(Property::Other(value.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -420,6 +421,7 @@ impl Display for Property {
|
|||
Property::HasAttachment => write!(f, "hasAttachment"),
|
||||
Property::Preview => write!(f, "preview"),
|
||||
Property::Header(header) => header.fmt(f),
|
||||
Property::Other(other) => write!(f, "{}", other),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue