From 949ea3bd6b4e117b57c87177e41b3c7efe27ab98 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Thu, 20 Feb 2020 12:48:55 -0500 Subject: [PATCH] Bump dependencies This also pulls in imap-proto 0.11, which exposes message envelopes as `&[u8]` instead of `&str`. This directly affects our public API. --- Cargo.toml | 4 ++-- src/parse.rs | 4 +++- tests/imap_integration.rs | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4ebeb9d..d2c5d51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,9 +29,9 @@ default = ["tls"] native-tls = { version = "0.2.2", optional = true } regex = "1.0" bufstream = "0.1" -imap-proto = "0.9.0" +imap-proto = "0.10.0" nom = "5.0" -base64 = "0.10" +base64 = "0.11" chrono = "0.4" lazy_static = "1.4" diff --git a/src/parse.rs b/src/parse.rs index 7c79b59..3a574b9 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -252,7 +252,9 @@ pub fn parse_mailbox( .flags .extend(flags.into_iter().map(String::from).map(Flag::from)); } - MailboxDatum::List { .. } => {} + MailboxDatum::List { .. } + | MailboxDatum::MetadataSolicited { .. } + | MailboxDatum::MetadataUnsolicited { .. } => {} } } Ok((rest, Response::Expunge(n))) => { diff --git a/tests/imap_integration.rs b/tests/imap_integration.rs index 8b1c629..f639684 100644 --- a/tests/imap_integration.rs +++ b/tests/imap_integration.rs @@ -139,17 +139,17 @@ fn inbox() { assert_ne!(fetch.uid, None); assert_eq!(fetch.size, Some(138)); let e = fetch.envelope().unwrap(); - assert_eq!(e.subject, Some("My first e-mail")); + assert_eq!(e.subject, Some(&b"My first e-mail"[..])); assert_ne!(e.from, None); assert_eq!(e.from.as_ref().unwrap().len(), 1); let from = &e.from.as_ref().unwrap()[0]; - assert_eq!(from.mailbox, Some("sender")); - assert_eq!(from.host, Some("localhost")); + assert_eq!(from.mailbox, Some(&b"sender"[..])); + assert_eq!(from.host, Some(&b"localhost"[..])); assert_ne!(e.to, None); assert_eq!(e.to.as_ref().unwrap().len(), 1); let to = &e.to.as_ref().unwrap()[0]; - assert_eq!(to.mailbox, Some("inbox")); - assert_eq!(to.host, Some("localhost")); + assert_eq!(to.mailbox, Some(&b"inbox"[..])); + assert_eq!(to.host, Some(&b"localhost"[..])); let date_opt = fetch.internal_date(); assert!(date_opt.is_some()); @@ -207,7 +207,7 @@ fn inbox_uid() { let fetch = &fetch[0]; assert_eq!(fetch.uid, Some(uid)); let e = fetch.envelope().unwrap(); - assert_eq!(e.subject, Some("My first e-mail")); + assert_eq!(e.subject, Some(&b"My first e-mail"[..])); let date_opt = fetch.internal_date(); assert!(date_opt.is_some());