diff options
| author | F001 <changchun.fan@qq.com> | 2018-05-28 14:35:12 +0800 |
|---|---|---|
| committer | F001 <changchun.fan@qq.com> | 2018-07-17 11:34:19 +0800 |
| commit | b1344abc58f0bd2eb6a8c9e664f8318864f640fe (patch) | |
| tree | f6d9bdc6ba1e725923a6d47521b938a964c681a3 | |
| parent | bdf86300b4170abef1399bb9b7bc63bac52a0092 (diff) | |
| download | rust-b1344abc58f0bd2eb6a8c9e664f8318864f640fe.tar.gz rust-b1344abc58f0bd2eb6a8c9e664f8318864f640fe.zip | |
code style fixes
| -rw-r--r-- | src/libcore/cell.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/rfc-1789-as-cell/from-mut.rs | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 85ef417ea15..a85eee85450 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -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] diff --git a/src/test/run-pass/rfc-1789-as-cell/from-mut.rs b/src/test/run-pass/rfc-1789-as-cell/from-mut.rs index 9989690bc79..8c7317b0e9a 100644 --- a/src/test/run-pass/rfc-1789-as-cell/from-mut.rs +++ b/src/test/run-pass/rfc-1789-as-cell/from-mut.rs @@ -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); } |
