Skip to content

Commit 2311cea

Browse files
committed
Cleanup shutdown call
1 parent f5a8b1d commit 2311cea

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

tokio-postgres/src/cancel_query_raw.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::config::SslMode;
22
use crate::tls::TlsConnect;
33
use crate::{connect_tls, Error};
4-
use futures::future;
54
use postgres_protocol::message::frontend;
6-
use std::pin::Pin;
75
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
86

97
pub async fn cancel_query_raw<S, T>(
@@ -24,9 +22,7 @@ where
2422

2523
stream.write_all(&buf).await.map_err(Error::io)?;
2624
stream.flush().await.map_err(Error::io)?;
27-
future::poll_fn(|cx| Pin::new(&mut stream).poll_shutdown(cx))
28-
.await
29-
.map_err(Error::io)?;
25+
stream.shutdown().await.map_err(Error::io)?;
3026

3127
Ok(())
3228
}

0 commit comments

Comments
 (0)