diff --git a/Cargo.toml b/Cargo.toml index f97629a..ed50bda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,6 @@ required-features = ["default"] name = "imap_integration" required-features = ["default"] -[patch.crates-io] -# https://github.com/djc/tokio-imap/pull/115 -imap-proto = { git = "https://github.com/jonhoo/tokio-imap.git", branch = "moo" } +# [patch.crates-io] +# # https://github.com/djc/tokio-imap/pull/115 +# imap-proto = { git = "https://github.com/jonhoo/tokio-imap.git", branch = "moo" } diff --git a/src/client.rs b/src/client.rs index e13dfd6..1725ebb 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1395,7 +1395,8 @@ impl Connection { tag, status, information, - code, + // TODO: https://github.com/djc/tokio-imap/pull/115 + // code, .. }, )) => { @@ -1403,11 +1404,18 @@ impl Connection { Some(match status { Status::Bad | Status::No => Err(( status, - information.map(|v| v.into_owned()), - code.map(|v| v.into_owned()), + information.map(|v| v.to_string()), + // TODO: https://github.com/djc/tokio-imap/pull/115 + // code.map(|v| v.into_owned()), + None, )), Status::Ok => Ok(()), - status => Err((status, None, code.map(|v| v.into_owned()))), + status => Err(( + status, None, + // TODO: https://github.com/djc/tokio-imap/pull/115 + // code.map(|v| v.into_owned()), + None, + )), }) } Ok((..)) => None, diff --git a/src/extensions/metadata.rs b/src/extensions/metadata.rs index 5683a11..71f8811 100644 --- a/src/extensions/metadata.rs +++ b/src/extensions/metadata.rs @@ -14,7 +14,7 @@ use crate::client::*; use crate::error::{Error, ParseError, Result}; use crate::parse::handle_unilateral; use crate::types::*; -use imap_proto::types::{MailboxDatum, Metadata, Response, ResponseCode}; +use imap_proto::types::{MailboxDatum, Metadata, Response}; use std::io::{Read, Write}; use std::sync::mpsc; @@ -200,7 +200,8 @@ impl Session { { match code { None => None, - Some(ResponseCode::MetadataLongEntries(v)) => Some(v), + // TODO: https://github.com/djc/tokio-imap/pull/116 + // Some(ResponseCode::MetadataLongEntries(v)) => Some(v), Some(_) => None, } } else { diff --git a/src/parse.rs b/src/parse.rs index 32b518e..0bcb151 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -1,6 +1,7 @@ use imap_proto::{MailboxDatum, Response, ResponseCode}; use lazy_static::lazy_static; use regex::Regex; +use std::borrow::Cow; use std::collections::HashSet; use std::sync::mpsc; @@ -80,8 +81,8 @@ pub fn parse_names( name, }) => Ok(MapOrNot::Map(Name { attributes: flags.into_iter().map(NameAttribute::from).collect(), - delimiter, - name, + delimiter: delimiter.map(Cow::Borrowed), + name: Cow::Borrowed(name), })), resp => Ok(MapOrNot::Not(resp)), };