diff --git a/src/postgres/connection/fetch.rs b/src/postgres/connection/fetch.rs index 1b5e154c..4b37b1b8 100644 --- a/src/postgres/connection/fetch.rs +++ b/src/postgres/connection/fetch.rs @@ -7,7 +7,7 @@ pub fn fetch<'a>( conn: &'a mut PostgresRawConnection, ) -> impl Stream> + 'a { async_stream::try_stream! { - conn.stream.flush().await.map_err(Error::Io)?; + conn.stream.flush().await.map_err(Error::from)?; while let Some(message) = conn.receive().await? { match message { diff --git a/src/postgres/connection/mod.rs b/src/postgres/connection/mod.rs index f4f8de77..4e31f8eb 100644 --- a/src/postgres/connection/mod.rs +++ b/src/postgres/connection/mod.rs @@ -34,9 +34,7 @@ pub struct PostgresRawConnection { impl PostgresRawConnection { async fn establish(url: &str) -> Result { let url = Url::parse(url); - let stream = TcpStream::connect(&url.address(5432)) - .await - .map_err(Error::Io)?; + let stream = TcpStream::connect(&url.address(5432)).await?; let mut conn = Self { stream: BufStream::new(stream),