Skip to content
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

Make clippy a mandatory test once more #1375

Merged
merged 24 commits into from
Jan 4, 2019

Conversation

mulkieran
Copy link
Member

@mulkieran mulkieran commented Dec 18, 2018

Resolves: #993.

All are allows or do what clippy recommends except for eaace9b, to which you might want to pay special attention.

@mulkieran mulkieran self-assigned this Dec 18, 2018
@mulkieran mulkieran force-pushed the master-clippy-run branch 7 times, most recently from b7a3320 to 712ab21 Compare December 21, 2018 19:30
@mulkieran mulkieran changed the title Run clippy in newest recommended way Make clippy a mandatory test once more Dec 21, 2018
Also, use flag for warning instead of environment variable.
This part is only to imitate recommended way.

Signed-off-by: mulhern <[email protected]>
clippy likes it better if we leave it out.

Signed-off-by: mulhern <[email protected]>
Because clippy likes the look and they are a bit more readable, too.

Signed-off-by: mulhern <[email protected]>
On the principle of least strength. Also, clippy prefers it.

Signed-off-by: mulhern <[email protected]>
It's quite possible that new shouldn't have been used in these cases.
Perhaps we can change some of these names later.

Signed-off-by: mulhern <[email protected]>
According to the principle of least strength. Also, clippy prefers it.

Signed-off-by: mulhern <[email protected]>
clippy thinks this is more concise.

Signed-off-by: mulhern <[email protected]>
rustc does not require it any more and clippy doesn't like it.

Signed-off-by: mulhern <[email protected]>
The compiler will now fail if the type cast from is unsafe to cast to a u64.

Signed-off-by: mulhern <[email protected]>
clippy prefers it and it is more usual.

Signed-off-by: mulhern <[email protected]>
It's just extra business.

Signed-off-by: mulhern <[email protected]>
Use unwrap_or_else instead.

Signed-off-by: mulhern <[email protected]>
clippy doesn't like it.

Signed-off-by: mulhern <[email protected]>
Otherwise, clippy will think that DeviceLimits type definition ought to be
Copy. We don't really want it to be Copy, because there is not guarantee
that it will stay so simple. Also, our purpose in passing is certainly not
to have it consumed.

Signed-off-by: mulhern <[email protected]>
Do eta conversion

Signed-off-by: mulhern <[email protected]>
The complex types are not really worth naming, given the function's
use.

Signed-off-by: mulhern <[email protected]>
I think it is doing the correct thing.

Signed-off-by: mulhern <[email protected]>
clippy doesn't like it. Also, using assert_matches allows the test, if it
fails to be a lot more informative.

Get rid of an unused method.

Signed-off-by: mulhern <[email protected]>
clippy doesn't like it and using assert_eq! will yield a better error
message.

Signed-off-by: mulhern <[email protected]>
In all cases, it seems to be what is actually intended.

Signed-off-by: mulhern <[email protected]>
All clippy lints and other clippy problems are dealt with now.

Signed-off-by: mulhern <[email protected]>
@mulkieran
Copy link
Member Author

This was failing on fedora-server-2 with udevadm issues, so I rebooted fedora-server-2 and re-ran.

Copy link
Contributor

@agrover agrover left a comment

Choose a reason for hiding this comment

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

Wow, there's a lot here! Looks great.

@mergify mergify bot merged commit 9fd8494 into stratis-storage:master Jan 4, 2019
@mulkieran mulkieran deleted the master-clippy-run branch January 4, 2019 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants