Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 913256d

Browse files
committed
Fix parsing of negative hex float literals in util
1 parent a65eb91 commit 913256d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/util/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn parse<T: FromStr + FromStrRadix>(input: &[&str], idx: usize) -> T {
274274

275275
let msg = || format!("invalid {} input '{s}'", type_name::<T>());
276276

277-
if s.starts_with("0x") {
277+
if s.starts_with("0x") || s.starts_with("-0x") {
278278
return T::from_str_radix(s, 16).unwrap_or_else(|_| panic!("{}", msg()));
279279
}
280280

0 commit comments

Comments
 (0)