File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,8 @@ impl<'a> Parser<'a> {
108108 } else {
109109 let f = {
110110 let prefix = start >= 2
111- && self
112- . input
113- . get ( start - 2 ..start - 1 )
114- . map_or ( false , |s| s == "/" ) ;
115- let suffix = self . cursor . peek ( ) . map_or ( true , |( _, c) | * c == '/' ) ;
111+ && ( self . input . get ( start - 2 ..start - 1 ) == Some ( "/" ) ) ;
112+ let suffix = self . cursor . peek ( ) . is_none_or ( |( _, c) | * c == '/' ) ;
116113 prefix && suffix
117114 } ;
118115 if c == '?' {
@@ -169,9 +166,8 @@ impl Iterator for Parser<'_> {
169166 Kind :: OneOrMore
170167 } else {
171168 let f = {
172- let prefix =
173- i >= 1 && self . input . get ( i - 1 ..i) . map_or ( false , |s| s == "/" ) ;
174- let suffix = self . cursor . peek ( ) . map_or ( true , |( _, c) | * c == '/' ) ;
169+ let prefix = i >= 1 && ( self . input . get ( i - 1 ..i) == Some ( "/" ) ) ;
170+ let suffix = self . cursor . peek ( ) . is_none_or ( |( _, c) | * c == '/' ) ;
175171 prefix && suffix
176172 } ;
177173 if f {
You can’t perform that action at this time.
0 commit comments