We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a90154d commit 9a932d2Copy full SHA for 9a932d2
postgres-tokio/src/lib.rs
@@ -324,13 +324,11 @@ impl Connection {
324
fn ready_err<T>(self, body: ErrorResponseBody<Vec<u8>>) -> BoxFuture<T, Error>
325
where T: 'static + Send
326
{
327
- self.ready(DbError::new(&mut body.fields()))
328
- .and_then(|(e, s)| {
329
- match e {
330
- Ok(e) => Err(Error::Db(Box::new(e), s)),
331
- Err(e) => Err(Error::Io(e)),
332
- }
333
- })
+ DbError::new(&mut body.fields())
+ .map_err(Error::Io)
+ .into_future()
+ .and_then(|e| self.ready(e))
+ .and_then(|(e, s)| Err(Error::Db(Box::new(e), s)))
334
.boxed()
335
}
336
0 commit comments