summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2022-06-08 00:13:17 -0400
committerOwen Jacobson <owen@grimoire.ca>2022-06-08 00:43:44 -0400
commit8d4bd121e9fe9183eac5323f505ac5f0b8848efe (patch)
tree052cd8208f6d73500584162fe1cea1e8c96ed6a5
parent63ff3d96d329db74f1703a6dc775cefcaa617823 (diff)
Remove now-spurious manual `From`.
This was obviated by upgrading past Actix 3.
-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)