Fix float with invalid suffix.
This commit is contained in:
parent
743cfcef05
commit
816b457c84
|
@ -1396,6 +1396,8 @@ impl<'a> Deserializer<'a> {
|
||||||
return Err(self.error(start, ErrorKind::NumberInvalid));
|
return Err(self.error(start, ErrorKind::NumberInvalid));
|
||||||
}
|
}
|
||||||
exponent = Some(a);
|
exponent = Some(a);
|
||||||
|
} else if !suffix.is_empty() {
|
||||||
|
return Err(self.error(start, ErrorKind::NumberInvalid));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut number = integral
|
let mut number = integral
|
||||||
|
|
|
@ -38,6 +38,8 @@ test!(empty_table,
|
||||||
include_str!("invalid/empty-table.toml"));
|
include_str!("invalid/empty-table.toml"));
|
||||||
test!(float_no_leading_zero,
|
test!(float_no_leading_zero,
|
||||||
include_str!("invalid/float-no-leading-zero.toml"));
|
include_str!("invalid/float-no-leading-zero.toml"));
|
||||||
|
test!(float_no_suffix,
|
||||||
|
include_str!("invalid/float-no-suffix.toml"));
|
||||||
test!(float_no_trailing_digits,
|
test!(float_no_trailing_digits,
|
||||||
include_str!("invalid/float-no-trailing-digits.toml"));
|
include_str!("invalid/float-no-trailing-digits.toml"));
|
||||||
test!(key_after_array,
|
test!(key_after_array,
|
||||||
|
|
1
test-suite/tests/invalid/float-no-suffix.toml
Normal file
1
test-suite/tests/invalid/float-no-suffix.toml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
a = 1.2f
|
Loading…
Reference in a new issue