Skip to content

Commit d1ab079

Browse files
committed
Fix clippy::assigning_clones warning
``` warning: assigning the result of `Clone::clone()` may be inefficient --> crossbeam-skiplist/src/base.rs:1958:17 | 1958 | self.head = next_head.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.head.clone_from(&next_head)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default warning: assigning the result of `Clone::clone()` may be inefficient --> crossbeam-skiplist/src/base.rs:1985:17 | 1985 | self.tail = next_tail.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.tail.clone_from(&next_tail)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones ```
1 parent 3045680 commit d1ab079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crossbeam-skiplist/src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ where
19461946
None => self.range.end_bound(),
19471947
};
19481948
if below_upper_bound(&bound, h.key().borrow()) {
1949-
self.head = next_head.clone();
1949+
self.head.clone_from(&next_head);
19501950
next_head
19511951
} else {
19521952
unsafe {
@@ -1973,7 +1973,7 @@ where
19731973
None => self.range.start_bound(),
19741974
};
19751975
if above_lower_bound(&bound, t.key().borrow()) {
1976-
self.tail = next_tail.clone();
1976+
self.tail.clone_from(&next_tail);
19771977
next_tail
19781978
} else {
19791979
unsafe {

0 commit comments

Comments
 (0)