diff options
| author | Mateusz Mikuła <matti@marinelayer.io> | 2019-07-18 14:16:04 +0200 |
|---|---|---|
| committer | Mateusz Mikuła <mati865@gmail.com> | 2019-07-18 15:14:56 +0200 |
| commit | f93032c818da6482777e6fa35a535a494241a0f1 (patch) | |
| tree | 14411ae51c1cab536393b68cdaf41b4ae62cea7d /src/liballoc | |
| parent | 21d5b8bf0c26e3ee4c270ce5527df66b1af56513 (diff) | |
| download | rust-f93032c818da6482777e6fa35a535a494241a0f1.tar.gz rust-f93032c818da6482777e6fa35a535a494241a0f1.zip | |
Fix clippy::clone_on_copy warnings
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/linked_list.rs | 8 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index db0d6e2f9b9..bbb96725ea0 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -237,15 +237,15 @@ impl<T> LinkedList<T> { // Not creating new mutable (unique!) references overlapping `element`. match node.prev { - Some(prev) => (*prev.as_ptr()).next = node.next.clone(), + Some(prev) => (*prev.as_ptr()).next = node.next, // this node is the head node - None => self.head = node.next.clone(), + None => self.head = node.next, }; match node.next { - Some(next) => (*next.as_ptr()).prev = node.prev.clone(), + Some(next) => (*next.as_ptr()).prev = node.prev, // this node is the tail node - None => self.tail = node.prev.clone(), + None => self.tail = node.prev, }; self.len -= 1; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 36d54656795..0d0ff7c16f1 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -815,7 +815,7 @@ impl<T> Rc<[T]> { let slice = from_raw_parts_mut(self.elems, self.n_elems); ptr::drop_in_place(slice); - Global.dealloc(self.mem, self.layout.clone()); + Global.dealloc(self.mem, self.layout); } } } diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 7cb826ee024..93aff733724 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -703,7 +703,7 @@ impl<T> Arc<[T]> { let slice = from_raw_parts_mut(self.elems, self.n_elems); ptr::drop_in_place(slice); - Global.dealloc(self.mem.cast(), self.layout.clone()); + Global.dealloc(self.mem.cast(), self.layout); } } } |
