From 7860b1408892ca6934d05796aaacf126971d42ac Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 6 Mar 2021 15:35:00 -0800 Subject: [PATCH] Revert "Release first 3.0.0 alpha" This reverts commit 8490407d2e63c90a427c028b075fa096ab031010. --- Cargo.toml | 6 +++--- src/client.rs | 16 ++++------------ src/extensions/metadata.rs | 5 ++--- src/parse.rs | 5 ++--- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed50bda..f97629a 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 1725ebb..e13dfd6 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1395,8 +1395,7 @@ impl Connection { tag, status, information, - // TODO: https://github.com/djc/tokio-imap/pull/115 - // code, + code, .. }, )) => { @@ -1404,18 +1403,11 @@ impl Connection { Some(match status { Status::Bad | Status::No => Err(( status, - information.map(|v| v.to_string()), - // TODO: https://github.com/djc/tokio-imap/pull/115 - // code.map(|v| v.into_owned()), - None, + information.map(|v| v.into_owned()), + code.map(|v| v.into_owned()), )), Status::Ok => Ok(()), - status => Err(( - status, None, - // TODO: https://github.com/djc/tokio-imap/pull/115 - // code.map(|v| v.into_owned()), - None, - )), + status => Err((status, None, code.map(|v| v.into_owned()))), }) } Ok((..)) => None, diff --git a/src/extensions/metadata.rs b/src/extensions/metadata.rs index 71f8811..5683a11 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}; +use imap_proto::types::{MailboxDatum, Metadata, Response, ResponseCode}; use std::io::{Read, Write}; use std::sync::mpsc; @@ -200,8 +200,7 @@ impl Session { { match code { None => None, - // TODO: https://github.com/djc/tokio-imap/pull/116 - // Some(ResponseCode::MetadataLongEntries(v)) => Some(v), + Some(ResponseCode::MetadataLongEntries(v)) => Some(v), Some(_) => None, } } else { diff --git a/src/parse.rs b/src/parse.rs index 0bcb151..32b518e 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -1,7 +1,6 @@ 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; @@ -81,8 +80,8 @@ pub fn parse_names( name, }) => Ok(MapOrNot::Map(Name { attributes: flags.into_iter().map(NameAttribute::from).collect(), - delimiter: delimiter.map(Cow::Borrowed), - name: Cow::Borrowed(name), + delimiter, + name, })), resp => Ok(MapOrNot::Not(resp)), };