From cf0223473f05a823e9cbd63741f3d7c8f21c5d9c Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 23 Jan 2021 16:11:33 +0100 Subject: [PATCH] allow more types to appear in AuthErrorOrOther (related to #20) --- src/result/auth_result.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/result/auth_result.rs b/src/result/auth_result.rs index 677053e..90e564e 100644 --- a/src/result/auth_result.rs +++ b/src/result/auth_result.rs @@ -69,10 +69,16 @@ impl From for AuthErrorOrOther { } } +mod private { + use gotham::anyhow; + pub trait Sealed {} + impl> Sealed for E {} +} + impl From for AuthErrorOrOther where // TODO https://gitlab.com/msrd0/gotham-restful/-/issues/20 - F: std::error::Error + Into + F: private::Sealed + Into { fn from(err: F) -> Self { Self::Other(err.into())