@@ -362,15 +362,15 @@ impl<'de, 'a> SeqAccess<'de> for ListIter<'de, 'a> {
362
362
if let Some ( mut content) = self . content . take ( ) {
363
363
// NOTE: when normalization will be implemented, it may be enough
364
364
// to check only b' ', because all whitespaces will be normalized
365
- const DELIMETERS : [ u8 ; 4 ] = [ b' ' , b'\t' , b'\r' , b'\n' ] ;
365
+ const DELIMETERS : & str = " \t \r \n " ;
366
366
367
367
loop {
368
368
let string = content. as_str ( ) ;
369
369
if string. is_empty ( ) {
370
370
return Ok ( None ) ;
371
371
}
372
372
373
- let first_delimiter = string. as_bytes ( ) . iter ( ) . position ( |c| DELIMETERS . contains ( c) ) ;
373
+ let first_delimiter = string. find ( |c| DELIMETERS . contains ( c) ) ;
374
374
375
375
return match first_delimiter {
376
376
// No delimiters in the `content`, deserialize it as a whole atomic
@@ -395,7 +395,7 @@ impl<'de, 'a> SeqAccess<'de> for ListIter<'de, 'a> {
395
395
// `content` started with a space, skip them all
396
396
Some ( 0 ) => {
397
397
// Skip all spaces
398
- let start = string. as_bytes ( ) . iter ( ) . position ( |c| !DELIMETERS . contains ( c) ) ;
398
+ let start = string. find ( |c| !DELIMETERS . contains ( c) ) ;
399
399
content = match ( start, content) {
400
400
// We cannot find any non-space character, so string contains only spaces
401
401
( None , _) => return Ok ( None ) ,
0 commit comments