Skip to content

Commit

Permalink
fix(ascii): Correctly parse 'infinity'
Browse files Browse the repository at this point in the history
This was identified in nom in rust-bakery/nom#1673
  • Loading branch information
epage committed Jul 6, 2023
1 parent c7c4b63 commit e711012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ascii/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,8 @@ where
alt((
recognize_float,
crate::token::tag_no_case("nan"),
crate::token::tag_no_case("inf"),
crate::token::tag_no_case("infinity"),
crate::token::tag_no_case("inf"),
))
.parse_next(input)
}
Expand Down
2 changes: 1 addition & 1 deletion src/ascii/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ mod complete {
assert_eq!(i, "");
let (i, inf) = float::<_, f32, ()>("infinity").unwrap();
assert!(inf.is_infinite());
assert_eq!(i, "inity");
assert_eq!(i, "");
}

#[cfg(feature = "std")]
Expand Down

0 comments on commit e711012

Please sign in to comment.