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. |
carllerche
left a comment
There was a problem hiding this comment.
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!
| waker: Arc<ThreadWaker>, | ||
| } | ||
|
|
||
| #[allow(clippy::mutex_atomic)] |
There was a problem hiding this comment.
I recommended removing this lint: rust-lang/rust-clippy#4295
There was a problem hiding this comment.
We probably should just disable this lint at the project level. This can happen in this PR or follow up work.
carllerche
left a comment
There was a problem hiding this comment.
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.
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_refmut_from_ref, etc.).Refs: https://rust-lang.github.io/rust-clippy/master/index.html (list of clippy lints)
cc @carllerche