Skip to content

Commit 62ca3e4

Browse files
committed
Handle Unexpected::Unit in Error::invalid_value
1 parent 296fafb commit 62ca3e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/error.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,15 @@ impl de::Error for Error {
444444
exp,
445445
))
446446
}
447+
448+
#[cold]
449+
fn invalid_value(unexp: de::Unexpected, exp: &dyn de::Expected) -> Self {
450+
Error::custom(format_args!(
451+
"invalid value: {}, expected {}",
452+
JsonUnexpected(unexp),
453+
exp,
454+
))
455+
}
447456
}
448457

449458
impl ser::Error for Error {

0 commit comments

Comments
 (0)