summaryrefslogtreecommitdiff
path: root/src/view.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/view.rs')
-rw-r--r--src/view.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/view.rs b/src/view.rs
index 9393d25..ba15915 100644
--- a/src/view.rs
+++ b/src/view.rs
@@ -73,21 +73,11 @@ use thiserror::Error;
#[derive(Error, Debug)]
enum UrlError {
#[error("Unable to generate URL: {0}")]
- UrlGenerationError(error::UrlGenerationError),
+ UrlGenerationError(#[from] error::UrlGenerationError),
#[error("Unable to generate URL: {0}")]
SerializationError(#[from] ser::Error),
}
-// In actix-web-2.0.0, UrlGenerationError neither implements Error nor Fail,
-// so thiserror can't automatically generate a From implementation for us.
-// This isn't perfect, but it gets the thing shipped. This omission is fixed in
-// actix_web 3.0.0, which is in alpha as of this writing.
-impl From<error::UrlGenerationError> for UrlError {
- fn from(err: error::UrlGenerationError) -> Self {
- UrlError::UrlGenerationError(err)
- }
-}
-
impl From<UrlError> for error::Error {
fn from(err: UrlError) -> Self {
error::ErrorInternalServerError(err)