add askama::Error behind feature flag

master
rascul 8 months ago
parent 3fb4b3dccf
commit 4099874de2

@ -8,6 +8,7 @@ license = "MIT"
keywords = ["error", "result"] keywords = ["error", "result"]
[dependencies] [dependencies]
askama = { version = "0.12", optional = true }
serde_json = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true }
ureq = { version = "2.6", optional = true } ureq = { version = "2.6", optional = true }

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

Loading…
Cancel
Save