add tokio-postgres behind feature flag

master
rascul 8 months ago
parent 38b72af396
commit a5b41dfe21

@ -11,6 +11,7 @@ keywords = ["error", "result"]
askama = { version = "0.12", optional = true }
log = { version = "0.4", features = ["std"], optional = true }
serde_json = { version = "1.0", optional = true }
tokio-postgres = { version = "0.7", optional = true}
ureq = { version = "2.6", optional = true }
[features]

@ -90,6 +90,13 @@ impl From<serde_json::Error> for Rear {
}
}
#[cfg(feature = "tokio_postgres")]
impl From<tokio_postgres::Error> for Rear {
fn from(error: tokio_postgres::Error) -> Self {
Self { message: error.to_string(), error: error.into() }
}
}
#[cfg(feature = "ureq")]
impl From<ureq::Error> for Rear {
fn from(error: ureq::Error) -> Self {

Loading…
Cancel
Save