mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
Remove an unneeded explicit error conversion
This commit is contained in:
parent
b4c39b6c7a
commit
5c5d027bf9
@ -7,7 +7,7 @@ pub fn fetch<'a>(
|
||||
conn: &'a mut PostgresRawConnection,
|
||||
) -> impl Stream<Item = Result<PostgresRow, Error>> + '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 {
|
||||
|
||||
@ -34,9 +34,7 @@ pub struct PostgresRawConnection {
|
||||
impl PostgresRawConnection {
|
||||
async fn establish(url: &str) -> Result<Self, Error> {
|
||||
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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user