From 781a51f03765c7351a95b34e8391f6a0cf5fc37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 5 Aug 2021 13:24:37 -0700 Subject: [PATCH] fix(protocol): fix the default From<:T Diagnostic> implementation to cover more cases. --- src/protocol.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/protocol.rs b/src/protocol.rs index a26f2a5..90be836 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -39,12 +39,24 @@ pub trait Diagnostic: std::error::Error { impl std::error::Error for Box {} -impl From for Box { +impl From for Box { fn from(diag: T) -> Self { Box::new(diag) } } +impl From for Box { + fn from(diag: T) -> Self { + Box::::from(diag) + } +} + +impl From for Box { + fn from(diag: T) -> Self { + Box::::from(diag) + } +} + /** Protocol for [Diagnostic] handlers, which are responsible for actually printing out Diagnostics.