-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ci: enable clippy lints #1335
ci: enable clippy lints #1335
Conversation
* clippy::mut_from_ref * clippy::map_clone * clippy::should_implement_trait * clippy::transmute_ptr_to_ptr * clippy::trivially_copy_pass_by_ref * clippy::type_complexity * clippy::module_inception * clippy::wrong_self_convention * clippy::mutex_atomic
* clippy::needless_lifetimes * clippy::unnecessary_mut_passed * clippy::assign_op_pattern * clippy::while_let_on_iterator * clippy::let_and_return * clippy::needless_range_loop * clippy::len_zero * clippy::single_match * clippy::match_bool * clippy::redundant_pattern_matching * clippy::needless_return * clippy::collapsible_if * clippy::let_unit_value * clippy::unit_arg * clippy::duration_subsec * clippy::redundant_closure * clippy::new_without_default * clippy::option_map_unit_fn * clippy::cast_lossless
This reverts commit 9761168. False positive has been fixed in newer nightly.
Seems rustfmt somehow checks the crates in |
@taiki-e that is very odd... adding clippy does this? |
Does this happen on master? |
I opened #1338 to check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looking good 👍
I added thoughts inline. Also, could we avoid file level allows in favor of adding them on the item? I'm not sure what they are referencing. thanks!
tokio-test/src/task.rs
Outdated
@@ -33,6 +33,7 @@ pub struct MockTask { | |||
waker: Arc<ThreadWaker>, | |||
} | |||
|
|||
#[allow(clippy::mutex_atomic)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommended removing this lint: rust-lang/rust-clippy#4295
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should just disable this lint at the project level. This can happen in this PR or follow up work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in ae3bd60.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
I think most of the allow
bits (that are not false positives) can be removed. That can happen here or later. I approved, so feel free to merge if you are happy.
pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> { | ||
self.io.get_ref().leave_multicast_v4(multiaddr, interface) | ||
pub fn leave_multicast_v4(&self, multiaddr: Ipv4Addr, interface: Ipv4Addr) -> io::Result<()> { | ||
self.io.get_ref().leave_multicast_v4(&multiaddr, &interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mio 0.7 changed this to pass by value 👍 : tokio-rs/mio#894
@carllerche I have removed all of |
Resolved a conflict, will merge once CI passed. |
Related: #1334
Those that may change the public API andThose that may change the implementation significantly is allowed (,trivially_copy_pass_by_ref
mut_from_ref
, etc.).Refs: https://rust-lang.github.io/rust-clippy/master/index.html (list of clippy lints)
cc @carllerche