Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

It's Clippy time! #3806

Merged
merged 1 commit into from
Oct 19, 2019
Merged

It's Clippy time! #3806

merged 1 commit into from
Oct 19, 2019

Conversation

c410-f3r
Copy link
Contributor

Compliance with all default hard errors and crates that are explicitly
using #![deny(warnings)].
There are some legitimate warnings like println!("") -> println!() but
they aren't considered in this PR.

@parity-cla-bot
Copy link

It looks like @c410-f3r signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

Copy link
Contributor

@Demi-Marie Demi-Marie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the manual implementation of Hash instead of manually implementing PartialEq.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to catch these mistakes/bad-practices with clippy or any other tool but since we don't use it in a structured way, I don't think we want to have clippy attributes anywhere in the code.

Though I might be wrong here.

@kianenigma kianenigma added the A0-please_review Pull request needs code review. label Oct 12, 2019
@c410-f3r
Copy link
Contributor Author

c410-f3r commented Oct 12, 2019

To remove all hard errors, more research is needed, specially inside the decl_runtime_apis! macro. Nevertheless, the ones covered in this PR are a great start IMO

@@ -178,7 +178,7 @@ macro_rules! implement_per_thing {
// `rem_multiplied_upper` is less than $max^2 therefore divided by $max it fits
// in $type. remember that $type always fits $max.
let mut rem_multiplied_divided_sized =
(rem_multiplied_upper / upper_max) as $type;
rem_multiplied_upper.div(upper_max) as $type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, how is that better?

Copy link
Contributor Author

@c410-f3r c410-f3r Oct 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please revert this? We should not include fixes for false positives in clippy.

@@ -178,7 +178,7 @@ macro_rules! implement_per_thing {
// `rem_multiplied_upper` is less than $max^2 therefore divided by $max it fits
// in $type. remember that $type always fits $max.
let mut rem_multiplied_divided_sized =
(rem_multiplied_upper / upper_max) as $type;
rem_multiplied_upper.div(upper_max) as $type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please revert this? We should not include fixes for false positives in clippy.

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall changes lgtm except for the two mentioned that you should revert.

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty

@bkchr
Copy link
Member

bkchr commented Oct 19, 2019

@c410-f3r you need to merge master.

Fix some Clippy issues
@c410-f3r
Copy link
Contributor Author

@bkchr Merged

@bkchr
Copy link
Member

bkchr commented Oct 19, 2019

Ty

@bkchr bkchr merged commit 5fde6d0 into paritytech:master Oct 19, 2019
@c410-f3r
Copy link
Contributor Author

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants