@@ -19,11 +19,7 @@ use std::fs;
19
19
use std:: io:: { self , BufRead , BufReader , Read } ;
20
20
use std:: iter:: Peekable ;
21
21
use std:: path:: { Path , PathBuf } ;
22
- <<<<<<< HEAD
23
22
use std:: str:: Chars ;
24
- =======
25
- use std:: str:: Bytes ;
26
- >>>>>>> c41b45169a6a8b461d6615fb59ade61182daf5f5
27
23
28
24
use rustfmt:: * ;
29
25
use rustfmt:: filemap:: { write_system_newlines, FileMap } ;
@@ -440,7 +436,6 @@ fn rustfmt_diff_no_diff_test() {
440
436
441
437
// Compare strings without distinguishing between CRLF and LF
442
438
fn string_eq_ignore_newline_repr ( left : & str , right : & str ) -> bool {
443
- <<<<<<< HEAD
444
439
let left = CharsIgnoreNewlineRepr ( left. chars ( ) . peekable ( ) ) ;
445
440
let right = CharsIgnoreNewlineRepr ( right. chars ( ) . peekable ( ) ) ;
446
441
left. eq ( right)
@@ -457,24 +452,6 @@ impl<'a> Iterator for CharsIgnoreNewlineRepr<'a> {
457
452
'\n'
458
453
} else {
459
454
'\r'
460
- =======
461
- let left = BytesIgnoreNewlineRepr ( left. bytes( ) . peekable( ) ) ;
462
- let right = BytesIgnoreNewlineRepr ( right. bytes( ) . peekable( ) ) ;
463
- left. eq( right)
464
- }
465
-
466
- struct BytesIgnoreNewlineRepr < ' a > ( Peekable < Bytes < ' a > > ) ;
467
-
468
- impl <' a > Iterator for BytesIgnoreNewlineRepr < ' a > {
469
- type Item = u8 ;
470
- fn next ( & mut self ) -> Option < u8 > {
471
- self . 0 . next( ) . map( |c| if c == b'\r' {
472
- if * self . 0 . peek( ) . unwrap_or( & 0 ) == b'\n' {
473
- self . 0 . next( ) ;
474
- b'\n'
475
- } else {
476
- b'\r'
477
- >>>>>>> c41b45169a6a8b461d6615fb59ade61182daf5f5
478
455
}
479
456
} else {
480
457
c
@@ -484,14 +461,10 @@ impl<'a> Iterator for BytesIgnoreNewlineRepr<'a> {
484
461
485
462
#[ test]
486
463
fn string_eq_ignore_newline_repr_test ( ) {
487
- <<<<<<< HEAD
488
464
assert ! ( string_eq_ignore_newline_repr( "" , "" ) ) ;
489
465
assert ! ( !string_eq_ignore_newline_repr( "" , "abc" ) ) ;
490
466
assert ! ( !string_eq_ignore_newline_repr( "abc" , "" ) ) ;
491
467
assert ! ( string_eq_ignore_newline_repr( "a\n b\n c\r d" , "a\n b\r \n c\r d" ) ) ;
492
468
assert ! ( string_eq_ignore_newline_repr( "a\r \n \r \n \r \n b" , "a\n \n \n b" ) ) ;
493
469
assert ! ( !string_eq_ignore_newline_repr( "a\r \n bcd" , "a\n bcdefghijk" ) ) ;
494
- =======
495
- assert ! ( string_eq_ignore_newline_repr( "a\n b\n c\r d" , "a\n b\r \n c\r d" ) ) ;
496
- >>>>>>> c41b45169a6a8b461d6615fb59ade61182daf5f5
497
470
}
0 commit comments