Fix parsing of negative hex float literals in util
This commit is contained in:
parent
e79fb05b25
commit
2a3ef8b9a2
1 changed files with 1 additions and 1 deletions
|
|
@ -274,7 +274,7 @@ fn parse<T: FromStr + FromStrRadix>(input: &[&str], idx: usize) -> T {
|
|||
|
||||
let msg = || format!("invalid {} input '{s}'", type_name::<T>());
|
||||
|
||||
if s.starts_with("0x") {
|
||||
if s.starts_with("0x") || s.starts_with("-0x") {
|
||||
return T::from_str_radix(s, 16).unwrap_or_else(|_| panic!("{}", msg()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue