feat(napi) implement From<Infallible> for napi::Error

This commit is contained in:
Sunli 2022-05-30 18:43:35 +08:00 committed by LongYinan
parent 56e71a76d3
commit 5cdfc8cb7e

View file

@ -34,6 +34,12 @@ unsafe impl Sync for Error {}
impl error::Error for Error {}
impl From<std::convert::Infallible> for Error {
fn from(_: std::convert::Infallible) -> Self {
unreachable!()
}
}
#[cfg(feature = "serde-json")]
impl ser::Error for Error {
fn custom<T: Display>(msg: T) -> Self {