Skip to content

Commit

Permalink
Make it compile with async_std
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Oct 12, 2024
1 parent b1878b8 commit ff7b949
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/extensions/compress.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! IMAP COMPRESS extension specified in [RFC4978](https://www.rfc-editor.org/rfc/rfc4978.html).
use std::fmt;
use std::io::IoSlice;
use std::pin::Pin;
use std::task::{Context, Poll};

Expand All @@ -14,7 +13,9 @@ use crate::types::IdGenerator;
use crate::Connection;

#[cfg(feature = "runtime-async-std")]
use async_std::io::{BufReader, Read, Write};
use async_std::io::{Read, Write};
#[cfg(feature = "runtime-async-std")]
use futures::io::BufReader;
#[cfg(feature = "runtime-tokio")]
use tokio::io::{AsyncRead as Read, AsyncWrite as Write, BufReader, ReadBuf};

Expand Down Expand Up @@ -54,15 +55,6 @@ impl<T: Read + Write + Unpin + fmt::Debug> DeflateStream<T> {
self.inner.get_mut().get_mut().get_mut()
}

/// Gets a pinned mutable reference to the underlying stream.
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> {
self.project()
.inner
.get_pin_mut()
.get_pin_mut()
.get_pin_mut()
}

/// Consumes `DeflateStream` and returns underlying stream.
pub fn into_inner(self) -> T {
self.inner.into_inner().into_inner().into_inner()
Expand Down Expand Up @@ -104,7 +96,7 @@ impl<T: Read + Write + Unpin + fmt::Debug> Write for DeflateStream<T> {
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
bufs: &[std::io::IoSlice<'_>],
) -> Poll<std::io::Result<usize>> {
self.project().inner.poll_write_vectored(cx, bufs)
}
Expand Down

0 comments on commit ff7b949

Please sign in to comment.