Add error handling and dependency injection example (#23)

This commit is contained in:
David Pedersen
2021-06-19 12:34:42 +02:00
committed by GitHub
parent 4fc3d8b5ba
commit 6a16cd40ca
3 changed files with 159 additions and 1 deletions
+12
View File
@@ -188,6 +188,12 @@ where
}
}
impl<T> From<T> for Html<T> {
fn from(inner: T) -> Self {
Self(inner)
}
}
/// A JSON response.
///
/// Can be created from any type that implements [`serde::Serialize`].
@@ -238,3 +244,9 @@ where
res
}
}
impl<T> From<T> for Json<T> {
fn from(inner: T) -> Self {
Self(inner)
}
}