Skip to content

Commit fd0ad9f

Browse files
committed
Fix clippy::needless_borrowed_reference warning
``` warning: dereferencing a tuple pattern where every element takes a reference --> crossbeam-skiplist/src/base.rs:1721:30 | 1721 | (Some(ref next), &Some(ref t)) if next.key() >= t.key() => { | ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference = note: `#[warn(clippy::needless_borrowed_reference)]` on by default help: try removing the `&` and `ref` parts | 1721 - (Some(ref next), &Some(ref t)) if next.key() >= t.key() => { 1721 + (Some(ref next), Some(t)) if next.key() >= t.key() => { | warning: dereferencing a tuple pattern where every element takes a reference --> crossbeam-skiplist/src/base.rs:1748:14 | 1748 | (&Some(ref h), Some(next)) if h.key() >= next.key() => { | ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 1748 - (&Some(ref h), Some(next)) if h.key() >= next.key() => { 1748 + (Some(h), Some(next)) if h.key() >= next.key() => { | ```
1 parent 374c5cd commit fd0ad9f

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
@@ -1718,7 +1718,7 @@ where
17181718
};
17191719
match (&next_head, &self.tail) {
17201720
// The next key is larger than the latest tail key we observed with this iterator.
1721-
(Some(ref next), &Some(ref t)) if next.key() >= t.key() => {
1721+
(Some(ref next), Some(t)) if next.key() >= t.key() => {
17221722
unsafe {
17231723
next.node.decrement(guard);
17241724
}
@@ -1745,7 +1745,7 @@ where
17451745
};
17461746
match (&self.head, &next_tail) {
17471747
// The prev key is smaller than the latest head key we observed with this iterator.
1748-
(&Some(ref h), Some(next)) if h.key() >= next.key() => {
1748+
(Some(h), Some(next)) if h.key() >= next.key() => {
17491749
unsafe {
17501750
next.node.decrement(guard);
17511751
}

0 commit comments

Comments
 (0)