diff --git a/tokio-postgres/src/cancel_query_raw.rs b/tokio-postgres/src/cancel_query_raw.rs index 08448ad6..d85b4281 100644 --- a/tokio-postgres/src/cancel_query_raw.rs +++ b/tokio-postgres/src/cancel_query_raw.rs @@ -1,9 +1,7 @@ use crate::config::SslMode; use crate::tls::TlsConnect; use crate::{connect_tls, Error}; -use futures::future; use postgres_protocol::message::frontend; -use std::pin::Pin; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; pub async fn cancel_query_raw( @@ -24,9 +22,7 @@ where stream.write_all(&buf).await.map_err(Error::io)?; stream.flush().await.map_err(Error::io)?; - future::poll_fn(|cx| Pin::new(&mut stream).poll_shutdown(cx)) - .await - .map_err(Error::io)?; + stream.shutdown().await.map_err(Error::io)?; Ok(()) }