Skip to content

Commit

Permalink
return unpacked stream
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Sep 23, 2024
1 parent 352be2e commit e5bb510
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Session<T> {
/// and `Err` if compression was not enabled.
pub async fn compress(
self,
) -> Result<std::result::Result<Session<DeflateStream<T>>, Session<T>>> {
) -> Result<std::result::Result<DeflateStream<T>, Session<T>>> {
let Self {
mut conn,
unsolicited_responses_tx,
Expand All @@ -1343,6 +1343,7 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Session<T> {

if true {
let deflate_stream = DeflateStream::new(stream);
/*
let stream = ImapStream::new(deflate_stream);
let conn = Connection {
stream,
Expand All @@ -1353,7 +1354,8 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Session<T> {
unsolicited_responses_tx,
unsolicited_responses,
};
Ok(Ok(session))
*/
Ok(Ok(deflate_stream))
} else {
let stream = ImapStream::new(stream);
let conn = Connection {
Expand Down

0 comments on commit e5bb510

Please sign in to comment.