@@ -53,7 +53,7 @@ fn eol() -> impl Parser<StringView, Output = Token, Error = ParserError> {
5353
5454fn cr_or_crlf ( ) -> impl Parser < StringView , Output = Token , Error = ParserError > {
5555 one_p ( '\r' )
56- . and_opt ( one_p ( '\n' ) , StringCombiner )
56+ . and ( one_p ( '\n' ) . to_option ( ) , StringCombiner )
5757 . to_token ( TokenType :: Eol )
5858}
5959
@@ -62,18 +62,20 @@ fn lf() -> impl Parser<StringView, Output = Token, Error = ParserError> {
6262}
6363
6464fn gt_or_ge ( ) -> impl Parser < StringView , Output = Token , Error = ParserError > {
65- one_p ( '>' ) . and_opt ( one_p ( '=' ) , StringCombiner ) . map ( |text| {
66- if text. len ( ) == 1 {
67- Token :: new ( TokenType :: Greater . get_index ( ) , text)
68- } else {
69- Token :: new ( TokenType :: GreaterEquals . get_index ( ) , text)
70- }
71- } )
65+ one_p ( '>' )
66+ . and ( one_p ( '=' ) . to_option ( ) , StringCombiner )
67+ . map ( |text| {
68+ if text. len ( ) == 1 {
69+ Token :: new ( TokenType :: Greater . get_index ( ) , text)
70+ } else {
71+ Token :: new ( TokenType :: GreaterEquals . get_index ( ) , text)
72+ }
73+ } )
7274}
7375
7476fn lt_or_le_or_ne ( ) -> impl Parser < StringView , Output = Token , Error = ParserError > {
7577 one_p ( '<' )
76- . and_opt ( one_p ( '>' ) . or ( one_p ( '=' ) ) , StringCombiner )
78+ . and ( one_of_p ( & [ '>' , '=' ] ) . to_option ( ) , StringCombiner )
7779 . map ( |text| {
7880 if text. len ( ) == 1 {
7981 Token :: new ( TokenType :: Less . get_index ( ) , text)
0 commit comments