File tree 1 file changed +7
-4
lines changed
compiler/rustc_data_structures/src/owning_ref
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -465,8 +465,9 @@ mod owning_ref_mut {
465
465
466
466
#[ test]
467
467
fn map_chained_inference ( ) {
468
- let or =
469
- BoxRefMut :: new ( Box :: new ( example ( ) . 1 ) ) . map_mut ( |x| & mut x[ ..5 ] ) . map_mut ( |x| & mut x[ 1 ..3 ] ) ;
468
+ let or = BoxRefMut :: new ( Box :: new ( example ( ) . 1 ) )
469
+ . map_mut ( |x| & mut x[ ..5 ] )
470
+ . map_mut ( |x| & mut x[ 1 ..3 ] ) ;
470
471
assert_eq ! ( & * or, "el" ) ;
471
472
}
472
473
@@ -508,9 +509,11 @@ mod owning_ref_mut {
508
509
509
510
#[ test]
510
511
fn erased_owner ( ) {
511
- let o1: BoxRefMut < Example , str > = BoxRefMut :: new ( Box :: new ( example ( ) ) ) . map_mut ( |x| & mut x. 1 [ ..] ) ;
512
+ let o1: BoxRefMut < Example , str > =
513
+ BoxRefMut :: new ( Box :: new ( example ( ) ) ) . map_mut ( |x| & mut x. 1 [ ..] ) ;
512
514
513
- let o2: BoxRefMut < String , str > = BoxRefMut :: new ( Box :: new ( example ( ) . 1 ) ) . map_mut ( |x| & mut x[ ..] ) ;
515
+ let o2: BoxRefMut < String , str > =
516
+ BoxRefMut :: new ( Box :: new ( example ( ) . 1 ) ) . map_mut ( |x| & mut x[ ..] ) ;
514
517
515
518
let os: Vec < ErasedBoxRefMut < str > > = vec ! [ o1. erase_owner( ) , o2. erase_owner( ) ] ;
516
519
assert ! ( os. iter( ) . all( |e| & e[ ..] == "hello world" ) ) ;
You can’t perform that action at this time.
0 commit comments