mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
code style fixes
This commit is contained in:
parent
bdf86300b4
commit
b1344abc58
@ -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]
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user