From fc101d0d6ba7becfefaf67ed7539e71bdeb02da5 Mon Sep 17 00:00:00 2001 From: Hana Date: Fri, 24 Feb 2023 19:46:39 +0800 Subject: [PATCH] fix(napi): display should be implemented on error generics (#1497) --- crates/napi/src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/napi/src/error.rs b/crates/napi/src/error.rs index 3e9a49c4..b716cd86 100644 --- a/crates/napi/src/error.rs +++ b/crates/napi/src/error.rs @@ -47,9 +47,9 @@ impl> ToNapiValue for Error { unsafe impl Send for Error where S: Send + AsRef {} unsafe impl Sync for Error where S: Sync + AsRef {} -impl error::Error for Error {} +impl + std::fmt::Debug> error::Error for Error {} -impl From for Error { +impl> From for Error { fn from(_: std::convert::Infallible) -> Self { unreachable!() } @@ -99,7 +99,7 @@ impl From for Error { } } -impl fmt::Display for Error { +impl + std::fmt::Debug> fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if !self.reason.is_empty() { write!(f, "{:?}, {}", self.status, self.reason)