diff options
| author | bors <bors@rust-lang.org> | 2017-08-16 04:00:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-16 04:00:24 +0000 |
| commit | 6f4ab9458a7ad06c8ce630604f533c8c0c0acef4 (patch) | |
| tree | 8b1076cf97b6482b624b3655e078a4530a460cb3 /src/liballoc | |
| parent | e40dc66f47614eb2d1c8026d112a27b6f8b291d0 (diff) | |
| parent | 1b6c9605e41b7c7dc23e0e6f633f05912d0463dd (diff) | |
| download | rust-6f4ab9458a7ad06c8ce630604f533c8c0c0acef4.tar.gz rust-6f4ab9458a7ad06c8ce630604f533c8c0c0acef4.zip | |
Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/binary_heap.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/btree/map.rs | 14 | ||||
| -rw-r--r-- | src/liballoc/btree/node.rs | 14 | ||||
| -rw-r--r-- | src/liballoc/linked_list.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/raw_vec.rs | 14 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/slice.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/string.rs | 10 | ||||
| -rw-r--r-- | src/liballoc/vec.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/vec_deque.rs | 2 |
12 files changed, 38 insertions, 38 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index daf556795fa..b967eaaaab5 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -278,7 +278,7 @@ impl<T> Arc<T> { let x: Box<_> = box ArcInner { strong: atomic::AtomicUsize::new(1), weak: atomic::AtomicUsize::new(1), - data: data, + data, }; Arc { ptr: Shared::from(Box::into_unique(x)) } } diff --git a/src/liballoc/binary_heap.rs b/src/liballoc/binary_heap.rs index 988f8851625..57640af816a 100644 --- a/src/liballoc/binary_heap.rs +++ b/src/liballoc/binary_heap.rs @@ -853,9 +853,9 @@ impl<'a, T> Hole<'a, T> { debug_assert!(pos < data.len()); let elt = ptr::read(&data[pos]); Hole { - data: data, + data, elt: Some(elt), - pos: pos, + pos, } } @@ -1203,7 +1203,7 @@ where T: Clone + Ord { let place = Placer::make_place(self.data.place_back()); BinaryHeapPlace { heap: ptr, - place: place, + place, } } } diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 6318d22059f..c0d43d9c527 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -169,7 +169,7 @@ fn make_place<T>() -> IntermediateBox<T> { IntermediateBox { ptr: p, - layout: layout, + layout, marker: marker::PhantomData, } } diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs index a51c70159db..f733c3332e2 100644 --- a/src/liballoc/btree/map.rs +++ b/src/liballoc/btree/map.rs @@ -234,7 +234,7 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<K, ()> match search::search_tree(self.root.as_mut(), key) { Found(handle) => { Some(OccupiedEntry { - handle: handle, + handle, length: &mut self.length, _marker: PhantomData, } @@ -250,8 +250,8 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<K, ()> Found(handle) => Some(mem::replace(handle.into_kv_mut().0, key)), GoDown(handle) => { VacantEntry { - key: key, - handle: handle, + key, + handle, length: &mut self.length, _marker: PhantomData, } @@ -695,7 +695,7 @@ impl<K: Ord, V> BTreeMap<K, V> { match search::search_tree(self.root.as_mut(), key) { Found(handle) => { Some(OccupiedEntry { - handle: handle, + handle, length: &mut self.length, _marker: PhantomData, } @@ -866,15 +866,15 @@ impl<K: Ord, V> BTreeMap<K, V> { match search::search_tree(self.root.as_mut(), &key) { Found(handle) => { Occupied(OccupiedEntry { - handle: handle, + handle, length: &mut self.length, _marker: PhantomData, }) } GoDown(handle) => { Vacant(VacantEntry { - key: key, - handle: handle, + key, + handle, length: &mut self.length, _marker: PhantomData, }) diff --git a/src/liballoc/btree/node.rs b/src/liballoc/btree/node.rs index 0e61905131f..b057c18fca8 100644 --- a/src/liballoc/btree/node.rs +++ b/src/liballoc/btree/node.rs @@ -776,8 +776,8 @@ impl<BorrowType, K, V, NodeType> Handle<NodeRef<BorrowType, K, V, NodeType>, mar debug_assert!(idx < node.len()); Handle { - node: node, - idx: idx, + node, + idx, _marker: PhantomData } } @@ -850,8 +850,8 @@ impl<BorrowType, K, V, NodeType> debug_assert!(idx <= node.len()); Handle { - node: node, - idx: idx, + node, + idx, _marker: PhantomData } } @@ -1149,7 +1149,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker:: let mut new_root = Root { node: BoxedNode::from_internal(new_node), - height: height + height, }; for i in 0..(new_len+1) { @@ -1449,12 +1449,12 @@ impl<BorrowType, K, V, HandleType> > { match self.node.force() { ForceResult::Leaf(node) => ForceResult::Leaf(Handle { - node: node, + node, idx: self.idx, _marker: PhantomData }), ForceResult::Internal(node) => ForceResult::Internal(Handle { - node: node, + node, idx: self.idx, _marker: PhantomData }) diff --git a/src/liballoc/linked_list.rs b/src/liballoc/linked_list.rs index 850dd6adcf0..f9512cbe977 100644 --- a/src/liballoc/linked_list.rs +++ b/src/liballoc/linked_list.rs @@ -140,7 +140,7 @@ impl<T> Node<T> { Node { next: None, prev: None, - element: element, + element, } } @@ -924,7 +924,7 @@ impl<'a, T> IterMut<'a, T> { let node = Some(Shared::from(Box::into_unique(box Node { next: Some(head), prev: Some(prev), - element: element, + element, }))); prev.as_mut().next = node; diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 6090fc3942a..9a8614895f3 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -60,8 +60,8 @@ impl<T, A: Alloc> RawVec<T, A> { // Unique::empty() doubles as "unallocated" and "zero-sized allocation" RawVec { ptr: Unique::empty(), - cap: cap, - a: a, + cap, + a, } } @@ -104,8 +104,8 @@ impl<T, A: Alloc> RawVec<T, A> { RawVec { ptr: Unique::new_unchecked(ptr as *mut _), - cap: cap, - a: a, + cap, + a, } } } @@ -159,8 +159,8 @@ impl<T, A: Alloc> RawVec<T, A> { pub unsafe fn from_raw_parts_in(ptr: *mut T, cap: usize, a: A) -> Self { RawVec { ptr: Unique::new_unchecked(ptr), - cap: cap, - a: a, + cap, + a, } } } @@ -176,7 +176,7 @@ impl<T> RawVec<T, Heap> { pub unsafe fn from_raw_parts(ptr: *mut T, cap: usize) -> Self { RawVec { ptr: Unique::new_unchecked(ptr), - cap: cap, + cap, a: Heap, } } diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index a2184054b37..9783aed895f 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -311,7 +311,7 @@ impl<T> Rc<T> { ptr: Shared::from(Box::into_unique(box RcBox { strong: Cell::new(1), weak: Cell::new(1), - value: value, + value, })), } } diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index ec7a2b6d0e8..356ca7a5f5e 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1886,7 +1886,7 @@ fn merge_sort<T, F>(v: &mut [T], mut is_less: F) // Push this run onto the stack. runs.push(Run { - start: start, + start, len: end - start, }); end = start; diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index a913d833a90..76ee0158a62 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1378,8 +1378,8 @@ impl String { let chars_iter = self[start..end].chars(); Drain { - start: start, - end: end, + start, + end, iter: chars_iter, string: self_ptr, } @@ -1442,11 +1442,11 @@ impl String { let chars_iter = self[start..end].chars(); Splice { - start: start, - end: end, + start, + end, iter: chars_iter, string: self_ptr, - replace_with: replace_with + replace_with, } } diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 9392ec3e6c5..8141851b8c9 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1728,9 +1728,9 @@ impl<T> IntoIterator for Vec<T> { mem::forget(self); IntoIter { buf: Shared::new_unchecked(begin), - cap: cap, + cap, ptr: begin, - end: end, + end, } } } diff --git a/src/liballoc/vec_deque.rs b/src/liballoc/vec_deque.rs index 2068c2c9c5f..bf906920029 100644 --- a/src/liballoc/vec_deque.rs +++ b/src/liballoc/vec_deque.rs @@ -2442,7 +2442,7 @@ impl<T> From<Vec<T>> for VecDeque<T> { VecDeque { tail: 0, head: len, - buf: buf, + buf, } } } |
