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

Various cleanup suggested by cargo clippy #395

Merged
merged 4 commits into from
Dec 26, 2020
Merged

Conversation

crawford
Copy link
Contributor

I noticed that PRs tend to get cluttered with a lot of warnings from cargo clippy, so I went through and started addressing some of the suggestions where I thought they make sense. Here's a collection of changes that I thought were non-controversial, but I have a bunch more locally, if folks think these sorts of changes are helpful.

These were flagged by `cargo clippy`:

    warning: this call to `as_ref` does nothing
    warning: this call to `as_mut` does nothing
These were flagged by `cargo clippy`:

    warning: using `println!("")`
    warning: using `write!()` with a format string that ends in a single
             newline
These were flagged by `cargo clippy`:

    warning: unneeded `return` statement
These were flagged by `cargo clippy`:

    warning: you don't need to add `&` to all patterns
@Dirbaio
Copy link
Member

Dirbaio commented Dec 26, 2020

Thanks for this. Please do send the others! If we get all the lints cleaned up we could set clippy to hard-fail CI so they aren't reintroduced.

Some should be disabled instead. For example match expression looks like matches! macro: the matches! macro doesn't work in Rust 1.36

@Dirbaio Dirbaio merged commit 965ff97 into smoltcp-rs:master Dec 26, 2020
@crawford crawford deleted the clippy branch December 27, 2020 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants