@@ -171,32 +171,34 @@ impl Atom {
171
171
let mut saw_backslash = false ;
172
172
for mut c in chars:: graphemes ( needle) {
173
173
if saw_backslash {
174
- if c == ' ' {
175
- needle_. push ( ' ' ) ;
174
+ if c. is_whitespace ( ) {
175
+ needle_. push ( c ) ;
176
176
saw_backslash = false ;
177
177
continue ;
178
178
} else {
179
179
needle_. push ( '\\' ) ;
180
180
}
181
181
}
182
182
saw_backslash = c == '\\' ;
183
- match case {
184
- #[ cfg( feature = "unicode-casefold" ) ]
185
- CaseMatching :: Ignore => c = chars:: to_lower_case ( c) ,
186
- #[ cfg( feature = "unicode-casefold" ) ]
187
- CaseMatching :: Smart => {
188
- ignore_case = ignore_case && !chars:: is_upper_case ( c)
183
+ if !saw_backslash {
184
+ match case {
185
+ #[ cfg( feature = "unicode-casefold" ) ]
186
+ CaseMatching :: Ignore => c = chars:: to_lower_case ( c) ,
187
+ #[ cfg( feature = "unicode-casefold" ) ]
188
+ CaseMatching :: Smart => {
189
+ ignore_case = ignore_case && !chars:: is_upper_case ( c)
190
+ }
191
+ CaseMatching :: Respect => ( ) ,
189
192
}
190
- CaseMatching :: Respect => ( ) ,
191
- }
192
- match normalization {
193
- # [ cfg ( feature = "unicode-normalization" ) ]
194
- Normalization :: Smart => {
195
- normalize = normalize && chars :: normalize ( c ) == c ;
193
+ match normalization {
194
+ # [ cfg ( feature = "unicode-normalization" ) ]
195
+ Normalization :: Smart => {
196
+ normalize = normalize && chars :: normalize ( c ) == c ;
197
+ }
198
+ Normalization :: Never => ( ) ,
196
199
}
197
- Normalization :: Never => ( ) ,
200
+ needle_ . push ( c ) ;
198
201
}
199
- needle_. push ( c) ;
200
202
}
201
203
} else {
202
204
let chars = chars:: graphemes ( needle) . map ( |mut c| {
0 commit comments