code style fixes

This commit is contained in:
F001 2018-05-28 14:35:12 +08:00
parent bdf86300b4
commit b1344abc58
2 changed files with 7 additions and 4 deletions

View File

@ -507,9 +507,11 @@ impl<T: ?Sized> Cell<T> {
/// ```
/// #![feature(as_cell)]
/// use std::cell::Cell;
///
/// 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[..];
/// assert_eq!(slice_cell.len(), 3);
/// ```

View File

@ -16,6 +16,7 @@ fn main() {
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..];
assert_eq!(sub_slice.len(), 2);
}