File tree 2 files changed +7
-4
lines changed
test/run-pass/rfc-1789-as-cell
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -507,10 +507,12 @@ impl<T: ?Sized> Cell<T> {
507
507
/// ```
508
508
/// #![feature(as_cell)]
509
509
/// use std::cell::Cell;
510
- /// let slice: &mut [i32] = &mut [1,2,3];
510
+ ///
511
+ /// let slice: &mut [i32] = &mut [1, 2, 3];
511
512
/// let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
512
513
/// assert_eq!(cell_slice.len(), 3);
513
- /// let slice_cell : &[Cell<i32>] = &cell_slice[..];
514
+ ///
515
+ /// let slice_cell: &[Cell<i32>] = &cell_slice[..];
514
516
/// assert_eq!(slice_cell.len(), 3);
515
517
/// ```
516
518
#[ inline]
Original file line number Diff line number Diff line change 13
13
use std:: cell:: Cell ;
14
14
15
15
fn main ( ) {
16
- let slice: & mut [ i32 ] = & mut [ 1 , 2 , 3 ] ;
16
+ let slice: & mut [ i32 ] = & mut [ 1 , 2 , 3 ] ;
17
17
let cell_slice: & Cell < [ i32 ] > = Cell :: from_mut ( slice) ;
18
18
assert_eq ! ( cell_slice. len( ) , 3 ) ;
19
- let sub_slice : & [ Cell < i32 > ] = & cell_slice[ 1 ..] ;
19
+
20
+ let sub_slice: & [ Cell < i32 > ] = & cell_slice[ 1 ..] ;
20
21
assert_eq ! ( sub_slice. len( ) , 2 ) ;
21
22
}
You can’t perform that action at this time.
0 commit comments