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

New clippy errors with Rust 1.53 #909

Closed
thanethomson opened this issue Jun 21, 2021 · 0 comments · Fixed by #910
Closed

New clippy errors with Rust 1.53 #909

thanethomson opened this issue Jun 21, 2021 · 0 comments · Fixed by #910
Assignees
Labels
bug Something isn't working code-quality Issues relating to linting configuration and general code quality

Comments

@thanethomson
Copy link
Contributor

I was busy preparing the v0.20.0 release when I discovered that it looks like a bunch of new clippy warnings have been introduced in Rust 1.53. These cause our clippy checks to fail since we fail on warnings.

Steps to reproduce

  1. Update to Rust 1.53
  2. Run the following:
cargo clippy --all-features --all-targets -- -Dwarnings -Drust-2018-idioms

You should get output resembling the following:

error: used `assert_eq!` with a literal bool
  --> proto/tests/unit.rs:66:5
   |
66 |     assert_eq!(new_domain_type.part_set_header_exists, false);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`
   |
   = note: `-D clippy::bool-assert-comparison` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison

error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
   --> tendermint/src/public_key.rs:159:21
    |
159 |     pub fn to_bytes(&self) -> Vec<u8> {
    |                     ^^^^^
    |
note: the lint level is defined here
   --> tendermint/src/lib.rs:9:5
    |
9   |     warnings,
    |     ^^^^^^^^
    = note: `#[deny(clippy::wrong_self_convention)]` implied by `#[deny(warnings)]`
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention

...

What's the definition of "done" for this issue?

When clippy, using Rust 1.53, gives us no errors.

@thanethomson thanethomson added bug Something isn't working code-quality Issues relating to linting configuration and general code quality labels Jun 21, 2021
@thanethomson thanethomson self-assigned this Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code-quality Issues relating to linting configuration and general code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant