Skip to content

Commit

Permalink
code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
F001 committed Jul 17, 2018
1 parent bdf8630 commit b1344ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/libcore/cell.rs
Expand Up @@ -507,10 +507,12 @@ impl<T: ?Sized> Cell<T> {
/// ```
/// #![feature(as_cell)]
/// use std::cell::Cell;
/// let slice: &mut [i32] = &mut [1,2,3];
///
/// let slice: &mut [i32] = &mut [1, 2, 3];
/// let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
/// assert_eq!(cell_slice.len(), 3);
/// let slice_cell : &[Cell<i32>] = &cell_slice[..];
///
/// let slice_cell: &[Cell<i32>] = &cell_slice[..];
/// assert_eq!(slice_cell.len(), 3);
/// ```
#[inline]
Expand Down
5 changes: 3 additions & 2 deletions src/test/run-pass/rfc-1789-as-cell/from-mut.rs
Expand Up @@ -13,9 +13,10 @@
use std::cell::Cell;

fn main() {
let slice: &mut [i32] = &mut [1,2,3];
let slice: &mut [i32] = &mut [1, 2, 3];
let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
assert_eq!(cell_slice.len(), 3);
let sub_slice : &[Cell<i32>] = &cell_slice[1..];

let sub_slice: &[Cell<i32>] = &cell_slice[1..];
assert_eq!(sub_slice.len(), 2);
}

0 comments on commit b1344ab

Please sign in to comment.