diff --git a/src/error.rs b/src/error.rs index c260fe17e..0e3323972 100644 --- a/src/error.rs +++ b/src/error.rs @@ -444,6 +444,15 @@ impl de::Error for Error { exp, )) } + + #[cold] + fn invalid_value(unexp: de::Unexpected, exp: &dyn de::Expected) -> Self { + Error::custom(format_args!( + "invalid value: {}, expected {}", + JsonUnexpected(unexp), + exp, + )) + } } impl ser::Error for Error {