-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix newly added clippy warnings #927
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
taiki-e
commented
Nov 17, 2022
``` 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 ```
bors r+ |
bors bot
added a commit
that referenced
this pull request
Nov 17, 2022
927: Fix clippy::explicit_auto_deref warning 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>
Build failed: |
``` error: the borrowed expression implements the required traits --> crossbeam-epoch/src/internal.rs:212:17 | 212 | &|sealed_bag: &SealedBag| sealed_bag.is_expired(global_epoch), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(|sealed_bag: &SealedBag| sealed_bag.is_expired(global_epoch))` | = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow ```
``` warning: binary comparison to literal `Option::None` --> crossbeam-channel/tests/golang.rs:1050:20 | 1050 | if c.recv() != None { | ^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `c.recv().is_some()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none = note: `#[warn(clippy::partialeq_to_none)]` on by default warning: binary comparison to literal `Option::None` --> crossbeam-channel/tests/golang.rs:1053:20 | 1053 | if c.try_recv() != None { | ^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `c.try_recv().is_some()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none ```
``` warning: passing a unit value to a function --> crossbeam-skiplist/benches/skiplist.rs:97:13 | 97 | black_box(map.remove(&num, guard).unwrap().release(guard)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg = note: `#[warn(clippy::unit_arg)]` on by default help: move the expression in front of the call and replace it with the unit literal `()` | 97 ~ map.remove(&num, guard).unwrap().release(guard); 98 ~ black_box(()); | ```
taiki-e
force-pushed
the
taiki-e/clippy
branch
from
November 17, 2022 03:56
be41189
to
f76c8b3
Compare
bors r+ |
bors bot
added a commit
that referenced
this pull request
Nov 17, 2022
927: Fix clippy::explicit_auto_deref warning 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>
Build failed: |
taiki-e
changed the title
Fix clippy::explicit_auto_deref warning
Fix newly added clippy warnings
Nov 17, 2022
bors r+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.