From e0a77d1569b65e14fbdd640bda4ac5e3d0b6a019 Mon Sep 17 00:00:00 2001 From: Mauro D Date: Wed, 3 May 2023 16:05:16 +0000 Subject: [PATCH] Clippy fixes. --- crates/jmap-proto/src/method/copy.rs | 14 +-- crates/jmap-proto/src/method/import.rs | 4 +- crates/jmap-proto/src/method/parse.rs | 8 +- crates/jmap-proto/src/method/query.rs | 50 ++++---- crates/jmap-proto/src/method/query_changes.rs | 4 +- .../jmap-proto/src/method/search_snippet.rs | 2 +- crates/jmap-proto/src/method/set.rs | 4 +- crates/jmap-proto/src/method/validate.rs | 2 +- crates/jmap-proto/src/object/email.rs | 6 +- .../jmap-proto/src/object/email_submission.rs | 2 +- crates/jmap-proto/src/object/index.rs | 2 +- crates/jmap-proto/src/object/sieve.rs | 4 +- crates/jmap-proto/src/request/capability.rs | 6 +- crates/jmap-proto/src/request/method.rs | 22 ++-- crates/jmap-proto/src/request/parser.rs | 4 +- crates/jmap-proto/src/types/acl.rs | 8 +- crates/jmap-proto/src/types/keyword.rs | 10 +- crates/jmap-proto/src/types/property.rs | 112 +++++++++--------- crates/jmap-proto/src/types/type_state.rs | 8 +- 19 files changed, 136 insertions(+), 136 deletions(-) diff --git a/crates/jmap-proto/src/method/copy.rs b/crates/jmap-proto/src/method/copy.rs index edc75160..83205423 100644 --- a/crates/jmap-proto/src/method/copy.rs +++ b/crates/jmap-proto/src/method/copy.rs @@ -108,18 +108,18 @@ impl JsonObjectParser for CopyRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 => { + 0x0064_4974_6e75_6f63_6361 => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x6574_6165_7263 => { request.create = , Object>>::parse(parser)?; } - 0x6449_746e_756f_6363_416d_6f72_66 => { + 0x0064_4974_6e75_6f63_6341_6d6f_7266 => { request.from_account_id = parser.next_token::()?.unwrap_string("fromAccountId")?; } - 0x6574_6174_536e_496d_6f72_4666_69 => { + 0x0065_7461_7453_6e49_6d6f_7246_6669 => { request.if_from_in_state = parser .next_token::()? .unwrap_string_or_null("ifFromInState")?; @@ -134,7 +134,7 @@ impl JsonObjectParser for CopyRequest { .next_token::()? .unwrap_string_or_null("destroyFromIfInState")?; } - 0x6574_6174_536e_4966_69 => { + 0x0065_7461_7453_6e49_6669 => { request.if_in_state = parser .next_token::()? .unwrap_string_or_null("ifInState")?; @@ -166,14 +166,14 @@ impl JsonObjectParser for CopyBlobRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 => { + 0x0064_4974_6e75_6f63_6361 => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } - 0x6449_746e_756f_6363_416d_6f72_66 => { + 0x0064_4974_6e75_6f63_6341_6d6f_7266 => { request.from_account_id = parser.next_token::()?.unwrap_string("fromAccountId")?; } - 0x7364_4962_6f6c_62 => { + 0x0073_6449_626f_6c62 => { request.blob_ids = parser .next_token::>()? .unwrap_string("blobIds")?; diff --git a/crates/jmap-proto/src/method/import.rs b/crates/jmap-proto/src/method/import.rs index f9cc99d9..ea4ae214 100644 --- a/crates/jmap-proto/src/method/import.rs +++ b/crates/jmap-proto/src/method/import.rs @@ -71,10 +71,10 @@ impl JsonObjectParser for ImportEmailRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 if !key.is_ref => { + 0x0064_4974_6e75_6f63_6361 if !key.is_ref => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } - 0x6574_6174_536e_4966_69 if !key.is_ref => { + 0x0065_7461_7453_6e49_6669 if !key.is_ref => { request.if_in_state = parser .next_token::()? .unwrap_string_or_null("ifInState")?; diff --git a/crates/jmap-proto/src/method/parse.rs b/crates/jmap-proto/src/method/parse.rs index 7d12d667..ee38f6f3 100644 --- a/crates/jmap-proto/src/method/parse.rs +++ b/crates/jmap-proto/src/method/parse.rs @@ -59,10 +59,10 @@ impl JsonObjectParser for ParseEmailRequest { while let Some(key) = parser.next_dict_key::()? { match (&key.hash[0], &key.hash[1]) { - (0x6449_746e_756f_6363_61, _) if !key.is_ref => { + (0x0064_4974_6e75_6f63_6361, _) if !key.is_ref => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } - (0x7364_4962_6f6c_62, _) => { + (0x0073_6449_626f_6c62, _) => { request.blob_ids = >::parse(parser)?; } (0x7365_6974_7265_706f_7270, _) => { @@ -71,12 +71,12 @@ impl JsonObjectParser for ParseEmailRequest { (0x7365_6974_7265_706f_7250_7964_6f62, _) => { request.body_properties = >>::parse(parser)?; } - (0x6c61_5679_646f_4274_7865_5468_6374_6566, 0x7365_75) => { + (0x6c61_5679_646f_4274_7865_5468_6374_6566, 0x0073_6575) => { request.fetch_text_body_values = parser .next_token::()? .unwrap_bool_or_null("fetchTextBodyValues")?; } - (0x6c61_5679_646f_424c_4d54_4868_6374_6566, 0x7365_75) => { + (0x6c61_5679_646f_424c_4d54_4868_6374_6566, 0x0073_6575) => { request.fetch_html_body_values = parser .next_token::()? .unwrap_bool_or_null("fetchHTMLBodyValues")?; diff --git a/crates/jmap-proto/src/method/query.rs b/crates/jmap-proto/src/method/query.rs index f247ef0c..1459bd86 100644 --- a/crates/jmap-proto/src/method/query.rs +++ b/crates/jmap-proto/src/method/query.rs @@ -173,7 +173,7 @@ impl JsonObjectParser for QueryRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 => { + 0x0064_4974_6e75_6f63_6361 => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x7265_746c_6966 => match parser.next_token::()? { @@ -207,7 +207,7 @@ impl JsonObjectParser for QueryRequest { .next_token::()? .unwrap_ints_or_null("anchorOffset")?; } - 0x7469_6d69_6c => { + 0x0074_696d_696c => { request.limit = parser .next_token::()? .unwrap_usize_or_null("limit")?; @@ -241,9 +241,9 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { filter[*pos_stack.last().unwrap()] = match &property.hash[0] { 0x726f_7461_7265_706f => { match parser.next_token::()?.unwrap_string("operator")? { - 0x444e_41 => Filter::And, + 0x0044_4e41 => Filter::And, 0x524f => Filter::Or, - 0x544f_4e => Filter::Not, + 0x0054_4f4e => Filter::Not, _ => return Err(parser.error_value()), } } @@ -252,7 +252,7 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { continue; } _ => match (&property.hash[0], &property.hash[1]) { - (0x6c69_616d_65, _) => { + (0x006c_6961_6d65, _) => { Filter::Email(parser.next_token::()?.unwrap_string("email")?) } (0x656d_616e, _) => { @@ -270,7 +270,7 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { (0x656e_6f7a_656d_6974, _) => Filter::Timezone( parser.next_token::()?.unwrap_string("timezone")?, ), - (0x7372_6562_6d65_6d, _) => { + (0x0073_7265_626d_656d, _) => { Filter::Members(parser.next_token::()?.unwrap_string("members")?) } (0x6e61_6854_7265_776f_4c61_746f_7571, _) => Filter::QuotaLt( @@ -285,11 +285,11 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { .unwrap_uint_or_null("quotaGreaterThan")? .unwrap_or_default() as u32, ), - (0x7364_4979_7469_746e_6564_69, _) => { + (0x0073_6449_7974_6974_6e65_6469, _) => { Filter::IdentityIds(>::parse(parser)?) } (0x7364_496c_6961_6d65, _) => Filter::EmailIds(>::parse(parser)?), - (0x7364_4964_6165_7268_74, _) => { + (0x0073_6449_6461_6572_6874, _) => { Filter::ThreadIds(>::parse(parser)?) } (0x7375_7461_7453_6f64_6e75, _) => Filter::UndoStatus( @@ -298,22 +298,22 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { (0x6572_6f66_6562, _) => { Filter::Before(parser.next_token::()?.unwrap_string("before")?) } - (0x7265_7466_61, _) => { + (0x0072_6574_6661, _) => { Filter::After(parser.next_token::()?.unwrap_string("after")?) } - (0x786f_626c_6961_4d6e_69, _) => Filter::InMailbox( + (0x0078_6f62_6c69_614d_6e69, _) => Filter::InMailbox( parser.next_token::()?.unwrap_string("inMailbox")?, ), (0x6854_7265_6874_4f78_6f62_6c69_614d_6e69, 0x6e61) => { Filter::InMailboxOtherThan(>::parse(parser)?) } - (0x657a_6953_6e69_6d, _) => Filter::MinSize( + (0x0065_7a69_536e_696d, _) => Filter::MinSize( parser .next_token::()? .unwrap_uint_or_null("minSize")? .unwrap_or_default() as u32, ), - (0x657a_6953_7861_6d, _) => Filter::MaxSize( + (0x0065_7a69_5378_616d, _) => Filter::MaxSize( parser .next_token::()? .unwrap_uint_or_null("maxSize")? @@ -326,14 +326,14 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { .unwrap_string("allInThreadHaveKeyword")?, ) } - (0x6576_6148_6461_6572_6854_6e49_656d_6f73, 0x6472_6f77_7965_4b) => { + (0x6576_6148_6461_6572_6854_6e49_656d_6f73, 0x0064_726f_7779_654b) => { Filter::SomeInThreadHaveKeyword( parser .next_token::()? .unwrap_string("someInThreadHaveKeyword")?, ) } - (0x6576_6148_6461_6572_6854_6e49_656e_6f6e, 0x6472_6f77_7965_4b) => { + (0x6576_6148_6461_6572_6854_6e49_656e_6f6e, 0x0064_726f_7779_654b) => { Filter::NoneInThreadHaveKeyword( parser .next_token::()? @@ -350,7 +350,7 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { .next_token::()? .unwrap_string("notKeyword")?, ), - (0x746e_656d_6863_6174_7441_7361_68, _) => Filter::HasAttachment( + (0x0074_6e65_6d68_6361_7474_4173_6168, _) => Filter::HasAttachment( parser .next_token::()? .unwrap_bool("hasAttachment")?, @@ -364,10 +364,10 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { (0x6363, _) => { Filter::Cc(parser.next_token::()?.unwrap_string("cc")?) } - (0x6363_62, _) => { + (0x0063_6362, _) => { Filter::Bcc(parser.next_token::()?.unwrap_string("bcc")?) } - (0x7463_656a_6275_73, _) => Filter::Subject( + (0x0074_6365_6a62_7573, _) => Filter::Subject( parser.next_token::()?.unwrap_string("subject")?, ), (0x7964_6f62, _) => { @@ -380,7 +380,7 @@ pub fn parse_filter(parser: &mut Parser) -> crate::parser::Result> { .next_token::()? .unwrap_string("sentBefore")?, ), - (0x7265_7466_4174_6e65_73, _) => Filter::SentAfter( + (0x0072_6574_6641_746e_6573, _) => Filter::SentAfter( parser.next_token::()?.unwrap_string("sentAfter")?, ), (0x6461_6572_6854_6e69, _) => { @@ -464,13 +464,13 @@ pub fn parse_sort(parser: &mut Parser) -> crate::parser::Result> }; while let Some(key) = parser.next_dict_key::()? { match key { - 0x676e_6964_6e65_6373_4173_69 => { + 0x0067_6e69_646e_6563_7341_7369 => { comp.is_ascending = parser .next_token::()? .unwrap_bool_or_null("isAscending")? .unwrap_or_default(); } - 0x6e6f_6974_616c_6c6f_63 => { + 0x006e_6f69_7461_6c6c_6f63 => { comp.collation = parser .next_token::()? .unwrap_string_or_null("collation")?; @@ -480,7 +480,7 @@ pub fn parse_sort(parser: &mut Parser) -> crate::parser::Result> .next_token::()? .unwrap_string("property")?; } - 0x6472_6f77_7965_6b => { + 0x0064_726f_7779_656b => { comp.keyword = parser .next_token::()? .unwrap_string_or_null("keyword")?; @@ -530,17 +530,17 @@ impl JsonObjectParser for SortProperty { match hash { 0x6570_7974 => Ok(SortProperty::Type), 0x656d_616e => Ok(SortProperty::Name), - 0x6c69_616d_65 => Ok(SortProperty::Email), - 0x6449_6c69_616d_65 => Ok(SortProperty::EmailId), + 0x006c_6961_6d65 => Ok(SortProperty::Email), + 0x0064_496c_6961_6d65 => Ok(SortProperty::EmailId), 0x6449_6461_6572_6874 => Ok(SortProperty::ThreadId), 0x7441_746e_6573 => Ok(SortProperty::SentAt), 0x7441_6465_7669_6563_6572 => Ok(SortProperty::ReceivedAt), 0x657a_6973 => Ok(SortProperty::Size), 0x6d6f_7266 => Ok(SortProperty::From), 0x6f74 => Ok(SortProperty::To), - 0x7463_656a_6275_73 => Ok(SortProperty::Subject), + 0x0074_6365_6a62_7573 => Ok(SortProperty::Subject), 0x6363 => Ok(SortProperty::Cc), - 0x7265_6472_4f74_726f_73 => Ok(SortProperty::SortOrder), + 0x0072_6564_724f_7472_6f73 => Ok(SortProperty::SortOrder), 0x6449_746e_6572_6170 => Ok(SortProperty::ParentId), 0x6576_6974_6341_7369 => Ok(SortProperty::IsActive), 0x6472_6f77_7965_4b73_6168 => Ok(SortProperty::HasKeyword), diff --git a/crates/jmap-proto/src/method/query_changes.rs b/crates/jmap-proto/src/method/query_changes.rs index 6d012839..946c68cf 100644 --- a/crates/jmap-proto/src/method/query_changes.rs +++ b/crates/jmap-proto/src/method/query_changes.rs @@ -85,7 +85,7 @@ impl JsonObjectParser for QueryChangesRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 => { + 0x0064_4974_6e75_6f63_6361 => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x7265_746c_6966 => match parser.next_token::()? { @@ -106,7 +106,7 @@ impl JsonObjectParser for QueryChangesRequest { return Err(token.error("sort", "array or null")); } }, - 0x6574_6174_5379_7265_7551_6563_6e69_73 => { + 0x0065_7461_7453_7972_6575_5165_636e_6973 => { request.since_query_state = parser .next_token::()? .unwrap_string("sinceQueryState")?; diff --git a/crates/jmap-proto/src/method/search_snippet.rs b/crates/jmap-proto/src/method/search_snippet.rs index 6fbec0fe..49a0a5a5 100644 --- a/crates/jmap-proto/src/method/search_snippet.rs +++ b/crates/jmap-proto/src/method/search_snippet.rs @@ -58,7 +58,7 @@ impl JsonObjectParser for GetSearchSnippetRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 if !key.is_ref => { + 0x0064_4974_6e75_6f63_6361 if !key.is_ref => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x7265_746c_6966 if !key.is_ref => match parser.next_token::()? { diff --git a/crates/jmap-proto/src/method/set.rs b/crates/jmap-proto/src/method/set.rs index bcba5ae3..59cf7210 100644 --- a/crates/jmap-proto/src/method/set.rs +++ b/crates/jmap-proto/src/method/set.rs @@ -126,7 +126,7 @@ impl JsonObjectParser for SetRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 if !key.is_ref => { + 0x0064_4974_6e75_6f63_6361 if !key.is_ref => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x6574_6165_7263 if !key.is_ref => { @@ -142,7 +142,7 @@ impl JsonObjectParser for SetRequest { Some(MaybeReference::Reference(ResultReference::parse(parser)?)) }; } - 0x6574_6174_536e_4966_69 if !key.is_ref => { + 0x0065_7461_7453_6e49_6669 if !key.is_ref => { request.if_in_state = parser .next_token::()? .unwrap_string_or_null("ifInState")?; diff --git a/crates/jmap-proto/src/method/validate.rs b/crates/jmap-proto/src/method/validate.rs index 892d68c5..3ccc07b5 100644 --- a/crates/jmap-proto/src/method/validate.rs +++ b/crates/jmap-proto/src/method/validate.rs @@ -36,7 +36,7 @@ impl JsonObjectParser for ValidateSieveScriptRequest { while let Some(key) = parser.next_dict_key::()? { match &key.hash[0] { - 0x6449_746e_756f_6363_61 if !key.is_ref => { + 0x0064_4974_6e75_6f63_6361 if !key.is_ref => { request.account_id = parser.next_token::()?.unwrap_string("accountId")?; } 0x6449_626f_6c62 if !key.is_ref => { diff --git a/crates/jmap-proto/src/object/email.rs b/crates/jmap-proto/src/object/email.rs index 914760da..2f829bb8 100644 --- a/crates/jmap-proto/src/object/email.rs +++ b/crates/jmap-proto/src/object/email.rs @@ -28,12 +28,12 @@ impl RequestPropertyParser for GetArguments { (0x7365_6974_7265_706f_7250_7964_6f62, _) => { self.body_properties = >>::parse(parser)?; } - (0x6c61_5679_646f_4274_7865_5468_6374_6566, 0x7365_75) => { + (0x6c61_5679_646f_4274_7865_5468_6374_6566, 0x0073_6575) => { self.fetch_text_body_values = parser .next_token::()? .unwrap_bool_or_null("fetchTextBodyValues")?; } - (0x6c61_5679_646f_424c_4d54_4868_6374_6566, 0x7365_75) => { + (0x6c61_5679_646f_424c_4d54_4868_6374_6566, 0x0073_6575) => { self.fetch_html_body_values = parser .next_token::()? .unwrap_bool_or_null("fetchHTMLBodyValues")?; @@ -61,7 +61,7 @@ impl RequestPropertyParser for QueryArguments { parser: &mut Parser, property: RequestProperty, ) -> crate::parser::Result { - if property.hash[0] == 0x7364_6165_7268_5465_7370_616c_6c6f_63 { + if property.hash[0] == 0x0073_6461_6572_6854_6573_7061_6c6c_6f63 { self.collapse_threads = parser .next_token::()? .unwrap_bool_or_null("collapseThreads")?; diff --git a/crates/jmap-proto/src/object/email_submission.rs b/crates/jmap-proto/src/object/email_submission.rs index 62ab0326..53544caa 100644 --- a/crates/jmap-proto/src/object/email_submission.rs +++ b/crates/jmap-proto/src/object/email_submission.rs @@ -27,7 +27,7 @@ impl RequestPropertyParser for SetArguments { , Object>>>::parse(parser)?; Ok(true) } else if property.hash[0] == 0x796f_7274_7365_4473_7365_6363_7553_6e6f - && property.hash[1] == 0x6c69_616d_45 + && property.hash[1] == 0x006c_6961_6d45 { self.on_success_destroy_email = >>>::parse(parser)?; diff --git a/crates/jmap-proto/src/object/index.rs b/crates/jmap-proto/src/object/index.rs index 21701983..7243279f 100644 --- a/crates/jmap-proto/src/object/index.rs +++ b/crates/jmap-proto/src/object/index.rs @@ -3,7 +3,7 @@ use std::{borrow::Cow, collections::HashSet}; use store::{ fts::builder::ToTokens, write::{BatchBuilder, BitmapFamily, IntoOperations, Operation}, - Serialize, BM_TAG, HASH_EXACT, + Serialize, HASH_EXACT, }; use crate::{ diff --git a/crates/jmap-proto/src/object/sieve.rs b/crates/jmap-proto/src/object/sieve.rs index 46970a8c..d7c213b5 100644 --- a/crates/jmap-proto/src/object/sieve.rs +++ b/crates/jmap-proto/src/object/sieve.rs @@ -17,14 +17,14 @@ impl RequestPropertyParser for SetArguments { property: RequestProperty, ) -> crate::parser::Result { if property.hash[0] == 0x7461_7669_7463_4173_7365_6363_7553_6e6f - && property.hash[1] == 0x7470_6972_6353_65 + && property.hash[1] == 0x0074_7069_7263_5365 { self.on_success_activate_script = parser .next_token::>()? .unwrap_string_or_null("onSuccessActivateScript")?; Ok(true) } else if property.hash[0] == 0x7669_7463_6165_4473_7365_6363_7553_6e6f - && property.hash[1] == 0x7470_6972_6353_6574_61 + && property.hash[1] == 0x0074_7069_7263_5365_7461 { self.on_success_deactivate_script = parser .next_token::()? diff --git a/crates/jmap-proto/src/request/capability.rs b/crates/jmap-proto/src/request/capability.rs index 054366c6..b8b8ff68 100644 --- a/crates/jmap-proto/src/request/capability.rs +++ b/crates/jmap-proto/src/request/capability.rs @@ -45,9 +45,9 @@ impl JsonObjectParser for Capability { 0x6e6f_6973_7369_6d62_7573 => Ok(Capability::Submission), 0x6573_6e6f_7073_6572_6e6f_6974_6163_6176 => Ok(Capability::VacationResponse), 0x7374_6361_746e_6f63 => Ok(Capability::Contacts), - 0x7372_6164_6e65_6c61_63 => Ok(Capability::Calendars), - 0x7465_6b63_6f73_6265_77 => Ok(Capability::WebSocket), - 0x6576_6569_73 => Ok(Capability::Sieve), + 0x0073_7261_646e_656c_6163 => Ok(Capability::Calendars), + 0x0074_656b_636f_7362_6577 => Ok(Capability::WebSocket), + 0x0065_7665_6973 => Ok(Capability::Sieve), _ => Err(parser.error_capability()), }, Err(Error::Method(_)) => Err(parser.error_capability()), diff --git a/crates/jmap-proto/src/request/method.rs b/crates/jmap-proto/src/request/method.rs index df23762a..2c6674ed 100644 --- a/crates/jmap-proto/src/request/method.rs +++ b/crates/jmap-proto/src/request/method.rs @@ -75,29 +75,29 @@ impl JsonObjectParser for MethodName { Ok(MethodName { obj: match obj_hash { - 0x6c69_616d_45 => MethodObject::Email, - 0x786f_626c_6961_4d => MethodObject::Mailbox, + 0x006c_6961_6d45 => MethodObject::Email, + 0x0078_6f62_6c69_614d => MethodObject::Mailbox, 0x6461_6572_6854 => MethodObject::Thread, 0x626f_6c42 => MethodObject::Blob, - 0x6e6f_6973_7369_6d62_7553_6c69_616d_45 => MethodObject::EmailSubmission, - 0x7465_7070_696e_5368_6372_6165_53 => MethodObject::SearchSnippet, + 0x006e_6f69_7373_696d_6275_536c_6961_6d45 => MethodObject::EmailSubmission, + 0x0074_6570_7069_6e53_6863_7261_6553 => MethodObject::SearchSnippet, 0x7974_6974_6e65_6449 => MethodObject::Identity, 0x6573_6e6f_7073_6552_6e6f_6974_6163_6156 => MethodObject::VacationResponse, 0x6e6f_6974_7069_7263_7362_7553_6873_7550 => MethodObject::PushSubscription, - 0x7470_6972_6353_6576_6569_53 => MethodObject::SieveScript, - 0x6c61_7069_636e_6972_50 => MethodObject::Principal, + 0x0074_7069_7263_5365_7665_6953 => MethodObject::SieveScript, + 0x006c_6170_6963_6e69_7250 => MethodObject::Principal, 0x6572_6f43 => MethodObject::Core, _ => return Err(parser.error_value()), }, fnc: match fnc_hash { - 0x7465_67 => MethodFunction::Get, - 0x7972_6575_71 => MethodFunction::Query, - 0x7465_73 => MethodFunction::Set, - 0x7365_676e_6168_63 => MethodFunction::Changes, + 0x0074_6567 => MethodFunction::Get, + 0x0079_7265_7571 => MethodFunction::Query, + 0x0074_6573 => MethodFunction::Set, + 0x0073_6567_6e61_6863 => MethodFunction::Changes, 0x7365_676e_6168_4379_7265_7571 => MethodFunction::QueryChanges, 0x7970_6f63 => MethodFunction::Copy, 0x7472_6f70_6d69 => MethodFunction::Import, - 0x6573_7261_70 => MethodFunction::Parse, + 0x0065_7372_6170 => MethodFunction::Parse, 0x6574_6164_696c_6176 => MethodFunction::Validate, 0x6f68_6365 => MethodFunction::Echo, _ => return Err(parser.error_value()), diff --git a/crates/jmap-proto/src/request/parser.rs b/crates/jmap-proto/src/request/parser.rs index ce7c28c0..895e4680 100644 --- a/crates/jmap-proto/src/request/parser.rs +++ b/crates/jmap-proto/src/request/parser.rs @@ -40,7 +40,7 @@ impl Request { parser.next_token::()?.assert(Token::DictStart)?; while let Some(key) = parser.next_dict_key::()? { match key { - 0x676e_6973_75 => { + 0x0067_6e69_7375 => { found_valid_keys = true; parser.next_token::()?.assert(Token::ArrayStart)?; loop { @@ -58,7 +58,7 @@ impl Request { } } } - 0x736c_6c61_4364_6f68_7465_6d => { + 0x0073_6c6c_6143_646f_6874_656d => { found_valid_keys = true; parser diff --git a/crates/jmap-proto/src/types/acl.rs b/crates/jmap-proto/src/types/acl.rs index 2b7a574e..bc941c98 100644 --- a/crates/jmap-proto/src/types/acl.rs +++ b/crates/jmap-proto/src/types/acl.rs @@ -40,11 +40,11 @@ impl JsonObjectParser for Acl { 0x6461_6572 => Ok(Acl::Read), 0x7966_6964_6f6d => Ok(Acl::Modify), 0x6574_656c_6564 => Ok(Acl::Delete), - 0x736d_6574_4964_6165_72 => Ok(Acl::ReadItems), + 0x0073_6d65_7449_6461_6572 => Ok(Acl::ReadItems), 0x736d_6574_4964_6461 => Ok(Acl::AddItems), - 0x736d_6574_4979_6669_646f_6d => Ok(Acl::ModifyItems), - 0x736d_6574_4965_766f_6d65_72 => Ok(Acl::RemoveItems), - 0x646c_6968_4365_7461_6572_63 => Ok(Acl::CreateChild), + 0x0073_6d65_7449_7966_6964_6f6d => Ok(Acl::ModifyItems), + 0x0073_6d65_7449_6576_6f6d_6572 => Ok(Acl::RemoveItems), + 0x0064_6c69_6843_6574_6165_7263 => Ok(Acl::CreateChild), 0x7265_7473_696e_696d_6461 => Ok(Acl::Administer), 0x7469_6d62_7573 => Ok(Acl::Submit), _ => Err(parser.error_value()), diff --git a/crates/jmap-proto/src/types/keyword.rs b/crates/jmap-proto/src/types/keyword.rs index 566d3091..9dd12f88 100644 --- a/crates/jmap-proto/src/types/keyword.rs +++ b/crates/jmap-proto/src/types/keyword.rs @@ -78,16 +78,16 @@ impl JsonObjectParser for Keyword { match hash { 0x6e65_6573 => return Ok(Keyword::Seen), 0x0074_6661_7264 => return Ok(Keyword::Draft), - 0x6465_6767_616c_66 => return Ok(Keyword::Flagged), + 0x0064_6567_6761_6c66 => return Ok(Keyword::Flagged), 0x6465_7265_7773_6e61 => return Ok(Keyword::Answered), 0x746e_6563_6572 => return Ok(Keyword::Recent), - 0x746e_6174_726f_706d_69 => return Ok(Keyword::Important), + 0x0074_6e61_7472_6f70_6d69 => return Ok(Keyword::Important), 0x676e_6968_7369_6870 => return Ok(Keyword::Phishing), 0x6b6e_756a => return Ok(Keyword::Junk), - 0x6b6e_756a_746f_6e => return Ok(Keyword::NotJunk), + 0x006b_6e75_6a74_6f6e => return Ok(Keyword::NotJunk), 0x0064_6574_656c_6564 => return Ok(Keyword::Deleted), - 0x6465_6472_6177_726f_66 => return Ok(Keyword::Forwarded), - 0x746e_6573_6e64_6d => return Ok(Keyword::MdnSent), + 0x0064_6564_7261_7772_6f66 => return Ok(Keyword::Forwarded), + 0x0074_6e65_736e_646d => return Ok(Keyword::MdnSent), _ => (), } } diff --git a/crates/jmap-proto/src/types/property.rs b/crates/jmap-proto/src/types/property.rs index 47709858..fc39da23 100644 --- a/crates/jmap-proto/src/types/property.rs +++ b/crates/jmap-proto/src/types/property.rs @@ -307,43 +307,43 @@ fn parse_property(first_char: u8, hash: u128) -> Option { }, b'b' => match hash { 0x6363 => Property::Bcc, - 0x6449_626f_6c => Property::BlobId, + 0x0064_4962_6f6c => Property::BlobId, 0x6572_7574_6375_7274_5379_646f => Property::BodyStructure, - 0x7365_756c_6156_7964_6f => Property::BodyValues, + 0x0073_6575_6c61_5679_646f => Property::BodyValues, _ => return None, }, b'c' => match hash { - 0x7365_6974_696c_6962_6170_61 => Property::Capabilities, + 0x0073_6569_7469_6c69_6261_7061 => Property::Capabilities, 0x63 => Property::Cc, 0x7465_7372_6168 => Property::Charset, 0x6469 => Property::Cid, _ => return None, }, b'd' => match hash { - 0x7375_7461_7453_7972_6576_696c_65 => Property::DeliveryStatus, + 0x0073_7574_6174_5379_7265_7669_6c65 => Property::DeliveryStatus, 0x6e6f_6974_7069_7263_7365 => Property::Description, - 0x6449_746e_6569_6c43_6563_6976_65 => Property::DeviceClientId, + 0x0064_4974_6e65_696c_4365_6369_7665 => Property::DeviceClientId, 0x6e6f_6974_6973_6f70_7369 => Property::Disposition, - 0x7364_4962_6f6c_426e_73 => Property::DsnBlobIds, + 0x0073_6449_626f_6c42_6e73 => Property::DsnBlobIds, _ => return None, }, b'e' => match hash { 0x6c69_616d => Property::Email, 0x6449_6c69_616d => Property::EmailId, - 0x7364_496c_6961_6d => Property::EmailIds, - 0x6570_6f6c_6576_6e => Property::Envelope, + 0x0073_6449_6c69_616d => Property::EmailIds, + 0x0065_706f_6c65_766e => Property::Envelope, 0x7365_7269_7078 => Property::Expires, _ => return None, }, b'f' => match hash { - 0x6d6f_72 => Property::From, - 0x6574_6144_6d6f_72 => Property::FromDate, + 0x006d_6f72 => Property::From, + 0x0065_7461_446d_6f72 => Property::FromDate, _ => return None, }, b'h' => match hash { 0x746e_656d_6863_6174_7441_7361 => Property::HasAttachment, 0x7372_6564_6165 => Property::Headers, - 0x7964_6f42_6c6d_74 => Property::HtmlBody, + 0x0079_646f_426c_6d74 => Property::HtmlBody, 0x6572_7574_616e_6769_536c_6d74 => Property::HtmlSignature, _ => return None, }, @@ -351,37 +351,37 @@ fn parse_property(first_char: u8, hash: u128) -> Option { 0x64 => Property::Id, 0x0064_4979_7469_746e_6564 => Property::IdentityId, 0x6f54_796c_7065_526e => Property::InReplyTo, - 0x6576_6974_6341_73 => Property::IsActive, + 0x0065_7669_7463_4173 => Property::IsActive, 0x6465_6c62_616e_4573 => Property::IsEnabled, - 0x6465_6269_7263_7362_7553_73 => Property::IsSubscribed, + 0x0064_6562_6972_6373_6275_5373 => Property::IsSubscribed, _ => return None, }, b'k' => match hash { - 0x7379_65 => Property::Keys, - 0x7364_726f_7779_65 => Property::Keywords, + 0x0073_7965 => Property::Keys, + 0x0073_6472_6f77_7965 => Property::Keywords, _ => return None, }, b'l' => match hash { - 0x6567_6175_676e_61 => Property::Language, - 0x6e6f_6974_6163_6f => Property::Location, + 0x0065_6761_7567_6e61 => Property::Language, + 0x006e_6f69_7461_636f => Property::Location, _ => return None, }, b'm' => match hash { - 0x7364_4978_6f62_6c69_61 => Property::MailboxIds, + 0x0073_6449_786f_626c_6961 => Property::MailboxIds, 0x6574_656c_6544_7961 => Property::MayDelete, 0x0073_6449_626f_6c42_6e64 => Property::MdnBlobIds, 0x7372_6562_6d65 => Property::Members, 0x6449_6567_6173_7365 => Property::MessageId, - 0x7374_6867_6952_79 => Property::MyRights, + 0x0073_7468_6769_5279 => Property::MyRights, _ => return None, }, b'n' => match hash { - 0x656d_61 => Property::Name, + 0x0065_6d61 => Property::Name, _ => return None, }, b'p' => match hash { - 0x6449_746e_6572_61 => Property::ParentId, - 0x6449_7472_61 => Property::PartId, + 0x0064_4974_6e65_7261 => Property::ParentId, + 0x0064_4974_7261 => Property::PartId, 0x6572_7574_6369 => Property::Picture, 0x7765_6976_6572 => Property::Preview, _ => return None, @@ -391,45 +391,45 @@ fn parse_property(first_char: u8, hash: u128) -> Option { _ => return None, }, b'r' => match hash { - 0x7441_6465_7669_6563_65 => Property::ReceivedAt, - 0x7365_636e_6572_6566_65 => Property::References, + 0x0074_4164_6576_6965_6365 => Property::ReceivedAt, + 0x0073_6563_6e65_7265_6665 => Property::References, 0x6f54_796c_7065 => Property::ReplyTo, - 0x656c_6f => Property::Role, + 0x0065_6c6f => Property::Role, _ => return None, }, b's' => match hash { - 0x7465_7263_65 => Property::Secret, - 0x7441_646e_65 => Property::SendAt, - 0x7265_646e_65 => Property::Sender, - 0x7441_746e_65 => Property::SentAt, - 0x657a_69 => Property::Size, + 0x0074_6572_6365 => Property::Secret, + 0x0074_4164_6e65 => Property::SendAt, + 0x0072_6564_6e65 => Property::Sender, + 0x0074_4174_6e65 => Property::SentAt, + 0x0065_7a69 => Property::Size, 0x7265_6472_4f74_726f => Property::SortOrder, 0x7463_656a_6275 => Property::Subject, 0x7374_7261_5062_7573 => Property::SubParts, _ => return None, }, b't' => match hash { - 0x7964_6f42_7478_65 => Property::TextBody, + 0x0079_646f_4274_7865 => Property::TextBody, 0x6572_7574_616e_6769_5374_7865 => Property::TextSignature, - 0x6449_6461_6572_68 => Property::ThreadId, - 0x656e_6f7a_656d_69 => Property::Timezone, + 0x0064_4964_6165_7268 => Property::ThreadId, + 0x0065_6e6f_7a65_6d69 => Property::Timezone, 0x6f => Property::To, - 0x6574_6144_6f => Property::ToDate, + 0x0065_7461_446f => Property::ToDate, 0x736c_6961_6d45_6c61_746f => Property::TotalEmails, - 0x7364_6165_7268_546c_6174_6f => Property::TotalThreads, - 0x6570_79 => Property::Type, + 0x0073_6461_6572_6854_6c61_746f => Property::TotalThreads, + 0x0065_7079 => Property::Type, 0x7365_7079 => Property::Types, _ => return None, }, b'u' => match hash { - 0x7375_7461_7453_6f64_6e => Property::UndoStatus, - 0x736c_6961_6d45_6461_6572_6e => Property::UnreadEmails, + 0x0073_7574_6174_536f_646e => Property::UndoStatus, + 0x0073_6c69_616d_4564_6165_726e => Property::UnreadEmails, 0x7364_6165_7268_5464_6165_726e => Property::UnreadThreads, 0x6c72 => Property::Url, _ => return None, }, b'v' => match hash { - 0x6564_6f43_6e6f_6974_6163_6966_6972_65 => Property::VerificationCode, + 0x0065_646f_436e_6f69_7461_6369_6669_7265 => Property::VerificationCode, _ => return None, }, _ => return None, @@ -478,12 +478,12 @@ fn parse_header_property(parser: &mut Parser) -> crate::parser::Result form = match hash { 0x7478_6554 => HeaderForm::Text, - 0x7365_7373_6572_6464_41 => HeaderForm::Addresses, + 0x0073_6573_7365_7264_6441 => HeaderForm::Addresses, 0x7365_7373_6572_6464_4164_6570_756f_7247 => HeaderForm::GroupedAddresses, 0x7364_4965_6761_7373_654d => HeaderForm::MessageIds, 0x6574_6144 => HeaderForm::Date, 0x734c_5255 => HeaderForm::URLs, - 0x7761_52 => HeaderForm::Raw, + 0x0077_6152 => HeaderForm::Raw, _ => return parser.invalid_property(), }; @@ -576,45 +576,45 @@ impl JsonObjectParser for ObjectProperty { _ => parser.invalid_property()?, }, b'l' => match hash { - 0x6567_6175_676e_61 => Property::Language, - 0x6e6f_6974_6163_6f => Property::Location, + 0x0065_6761_7567_6e61 => Property::Language, + 0x006e_6f69_7461_636f => Property::Location, _ => parser.invalid_property()?, }, b'm' => match hash { - 0x6d6f_7246_6c69_61 => Property::MailFrom, - 0x736d_6574_4964_6165_5279_61 => Property::MayReadItems, + 0x006d_6f72_466c_6961 => Property::MailFrom, + 0x0073_6d65_7449_6461_6552_7961 => Property::MayReadItems, 0x736d_6574_4964_6441_7961 => Property::MayAddItems, - 0x736d_6574_4965_766f_6d65_5279_61 => Property::MayRemoveItems, - 0x6e65_6553_7465_5379_61 => Property::MaySetSeen, - 0x7364_726f_7779_654b_7465_5379_61 => Property::MaySetKeywords, - 0x646c_6968_4365_7461_6572_4379_61 => Property::MayCreateChild, + 0x0073_6d65_7449_6576_6f6d_6552_7961 => Property::MayRemoveItems, + 0x006e_6565_5374_6553_7961 => Property::MaySetSeen, + 0x0073_6472_6f77_7965_4b74_6553_7961 => Property::MaySetKeywords, + 0x0064_6c69_6843_6574_6165_7243_7961 => Property::MayCreateChild, 0x656d_616e_6552_7961 => Property::MayRename, 0x6574_656c_6544_7961 => Property::MayDelete, 0x7469_6d62_7553_7961 => Property::MaySubmit, _ => parser.invalid_property()?, }, b'n' => match hash { - 0x656d_61 => Property::Name, + 0x0065_6d61 => Property::Name, _ => parser.invalid_property()?, }, b'p' => match hash { - 0x6449_7472_61 => Property::PartId, + 0x0064_4974_7261 => Property::PartId, 0x0068_6436_3532 => Property::P256dh, - 0x7372_6574_656d_6172_61 => Property::Parameters, + 0x0073_7265_7465_6d61_7261 => Property::Parameters, _ => parser.invalid_property()?, }, b'r' => match hash { - 0x6f54_7470_63 => Property::RcptTo, + 0x006f_5474_7063 => Property::RcptTo, _ => parser.invalid_property()?, }, b's' => match hash { - 0x657a_69 => Property::Size, - 0x7374_7261_5062_75 => Property::SubParts, + 0x0065_7a69 => Property::Size, + 0x0073_7472_6150_6275 => Property::SubParts, 0x796c_7065_5270_746d => Property::SmtpReply, _ => parser.invalid_property()?, }, b't' => match hash { - 0x6570_79 => Property::Type, + 0x0065_7079 => Property::Type, _ => parser.invalid_property()?, }, b'v' => match hash { diff --git a/crates/jmap-proto/src/types/type_state.rs b/crates/jmap-proto/src/types/type_state.rs index e84d00a8..5e3c2e61 100644 --- a/crates/jmap-proto/src/types/type_state.rs +++ b/crates/jmap-proto/src/types/type_state.rs @@ -40,10 +40,10 @@ impl JsonObjectParser for TypeState { } match hash { - 0x6c69_616d_45 => Ok(TypeState::Email), - 0x7972_6576_696c_6544_6c69_616d_45 => Ok(TypeState::EmailDelivery), - 0x6e6f_6973_7369_6d62_7553_6c69_616d_45 => Ok(TypeState::EmailSubmission), - 0x786f_626c_6961_4d => Ok(TypeState::Mailbox), + 0x006c_6961_6d45 => Ok(TypeState::Email), + 0x0079_7265_7669_6c65_446c_6961_6d45 => Ok(TypeState::EmailDelivery), + 0x006e_6f69_7373_696d_6275_536c_6961_6d45 => Ok(TypeState::EmailSubmission), + 0x0078_6f62_6c69_614d => Ok(TypeState::Mailbox), 0x6461_6572_6854 => Ok(TypeState::Thread), 0x7974_6974_6e65_6449 => Ok(TypeState::Identity), _ => Err(parser.error_value()),