We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 107c2d1 commit 83d7badCopy full SHA for 83d7bad
src/error.rs
@@ -466,10 +466,14 @@ struct JsonUnexpected<'a>(de::Unexpected<'a>);
466
467
impl<'a> Display for JsonUnexpected<'a> {
468
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
469
- if let de::Unexpected::Unit = self.0 {
470
- formatter.write_str("null")
471
- } else {
472
- Display::fmt(&self.0, formatter)
+ match self.0 {
+ de::Unexpected::Unit => formatter.write_str("null"),
+ de::Unexpected::Float(value) => write!(
+ formatter,
473
+ "floating point `{}`",
474
+ ryu::Buffer::new().format(value),
475
+ ),
476
+ unexp => Display::fmt(&unexp, formatter),
477
}
478
479
0 commit comments