From 8d4bd121e9fe9183eac5323f505ac5f0b8848efe Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 8 Jun 2022 00:13:17 -0400 Subject: Remove now-spurious manual `From`. This was obviated by upgrading past Actix 3. --- src/view.rs | 12 +----------- 1 file changed, 1 insertion(+), 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 for UrlError { - fn from(err: error::UrlGenerationError) -> Self { - UrlError::UrlGenerationError(err) - } -} - impl From for error::Error { fn from(err: UrlError) -> Self { error::ErrorInternalServerError(err) -- cgit v1.2.3