Skip to content

Commit

Permalink
Merge #927
Browse files Browse the repository at this point in the history
927: Fix newly added clippy warnings r=taiki-e a=taiki-e

```
error: deref which would be done by auto-deref
   --> crossbeam-utils/src/sync/wait_group.rs:142:29
    |
142 |         let count: &usize = &*self.inner.count.lock().unwrap();
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&self.inner.count.lock().unwrap()`
    |
    = note: `-D clippy::explicit-auto-deref` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
```

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed Nov 17, 2022
2 parents 46d0aeb + f76c8b3 commit c840da4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crossbeam-channel/tests/golang.rs
Expand Up @@ -1047,10 +1047,10 @@ mod chan_test {
}
}

if c.recv() != None {
if c.recv().is_some() {
panic!();
}
if c.try_recv() != None {
if c.try_recv().is_some() {
panic!();
}
}
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-epoch/src/internal.rs
Expand Up @@ -209,7 +209,7 @@ impl Global {

for _ in 0..steps {
match self.queue.try_pop_if(
&|sealed_bag: &SealedBag| sealed_bag.is_expired(global_epoch),
|sealed_bag: &SealedBag| sealed_bag.is_expired(global_epoch),
guard,
) {
None => break,
Expand Down
1 change: 1 addition & 0 deletions crossbeam-skiplist/benches/skiplist.rs
@@ -1,4 +1,5 @@
#![feature(test)]
#![allow(clippy::unit_arg)]

extern crate test;

Expand Down
2 changes: 1 addition & 1 deletion crossbeam-utils/src/sync/wait_group.rs
Expand Up @@ -139,7 +139,7 @@ impl Clone for WaitGroup {

impl fmt::Debug for WaitGroup {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let count: &usize = &*self.inner.count.lock().unwrap();
let count: &usize = &self.inner.count.lock().unwrap();
f.debug_struct("WaitGroup").field("count", count).finish()
}
}

0 comments on commit c840da4

Please sign in to comment.