rust-embedded-community / serde-json-core

`serde-json` for `no_std` programs
Apache License 2.0
161 stars 59 forks source link

Float deserialization fails when no trailing characters are present #47

Closed ryan-summers closed 3 years ago

ryan-summers commented 3 years ago

When deserializing a simple float JSON (for example, 1.0 is valid JSON), an EofWhileParsingFloat will be raised. This occurs because the float parser expects some non-numeric data after the float.

However, an EOF is considered an acceptable terminator for a floating point number. We should update float parsing to return the current string if EOF is encountered instead of throwing an error.