Skip to content

Commit 0aedfce

Browse files
committed
Fix inability to parse scientific-notation floats without a decimal point
1 parent 65aee42 commit 0aedfce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/input/parse_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'de> Deserialize<'de> for JsonInput {
146146

147147
if let JsonInput::String(s) = &first_value {
148148
// Normalize the string to either an int or float
149-
let normalized = if s.contains('.') {
149+
let normalized = if s.contains('.') || s.contains('e') {
150150
JsonInput::Float(
151151
s.parse()
152152
.map_err(|e| V::Error::custom(format!("expected a float: {e}")))?,

0 commit comments

Comments
 (0)