From e7110127043f04ac309f15f4ce69b2ead5acb5cb Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 29 Jun 2023 10:02:17 -0500 Subject: [PATCH] fix(ascii): Correctly parse 'infinity' This was identified in nom in rust-bakery/nom#1673 --- src/ascii/mod.rs | 2 +- src/ascii/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ascii/mod.rs b/src/ascii/mod.rs index 7c4ff39b..90294b90 100644 --- a/src/ascii/mod.rs +++ b/src/ascii/mod.rs @@ -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) } diff --git a/src/ascii/tests.rs b/src/ascii/tests.rs index bc93d2ed..f3febadc 100644 --- a/src/ascii/tests.rs +++ b/src/ascii/tests.rs @@ -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")]