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

Fix clippy warnings with newer Rust #853

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

schneems
Copy link
Contributor

Similar to:

$ cargo clippy --all-targets --all-features -- --deny warnings
    Checking num-rational v0.4.2
   Compiling libcnb-proc-macros v0.22.0 (/Users/rschneeman/Documents/projects/work/libcnb.rs/libcnb-proc-macros)
    Checking libcnb-common v0.22.0 (/Users/rschneeman/Documents/projects/work/libcnb.rs/libcnb-common)
    Checking time v0.3.30
    Checking ahash v0.8.11
    Checking opentelemetry_sdk v0.21.2
error: lint group `pedantic` has the same priority (0) as a lint
  --> Cargo.toml:33:1
   |
33 | pedantic = "warn"
   | ^^^^^^^^   ------ has an implicit priority of 0
34 | unwrap_used = "warn"
   | ----------- has the same priority as this lint
   |
   = note: the order of the lints in the table is ignored by Cargo
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
   = note: `#[deny(clippy::lint_groups_priority)]` on by default
help: to have lints override the group set `pedantic` to a lower priority
   |
33 | pedantic = { level = "warn", priority = -1 }
   |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Similar to:

- https://github.com/heroku/buildpacks-python/blob/bb0264c8bb0c8b429951c97bf9fdfb894bb78878/Cargo.toml#L15-L16
- heroku/buildpacks-ruby@87c5302

```
$ cargo clippy --all-targets --all-features -- --deny warnings
    Checking num-rational v0.4.2
   Compiling libcnb-proc-macros v0.22.0 (/Users/rschneeman/Documents/projects/work/libcnb.rs/libcnb-proc-macros)
    Checking libcnb-common v0.22.0 (/Users/rschneeman/Documents/projects/work/libcnb.rs/libcnb-common)
    Checking time v0.3.30
    Checking ahash v0.8.11
    Checking opentelemetry_sdk v0.21.2
error: lint group `pedantic` has the same priority (0) as a lint
  --> Cargo.toml:33:1
   |
33 | pedantic = "warn"
   | ^^^^^^^^   ------ has an implicit priority of 0
34 | unwrap_used = "warn"
   | ----------- has the same priority as this lint
   |
   = note: the order of the lints in the table is ignored by Cargo
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
   = note: `#[deny(clippy::lint_groups_priority)]` on by default
help: to have lints override the group set `pedantic` to a lower priority
   |
33 | pedantic = { level = "warn", priority = -1 }
   |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
```
error: the borrowed expression implements the required traits
  --> libcnb-package/src/package.rs:67:24
   |
67 |         .manifest_path(&buildpack_directory.join("Cargo.toml"))
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `buildpack_directory.join("Cargo.toml")`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `-D clippy::needless-borrows-for-generic-args` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_borrows_for_generic_args)]`

error: could not compile `libcnb-package` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.
```
@schneems schneems marked this pull request as ready for review August 27, 2024 16:34
@schneems schneems requested a review from a team as a code owner August 27, 2024 16:34
@schneems schneems enabled auto-merge (squash) August 27, 2024 16:34
@edmorley edmorley changed the title Fix clippy warning Fix clippy warnings with newer Rust Aug 27, 2024
@edmorley edmorley disabled auto-merge August 27, 2024 17:03
@edmorley edmorley enabled auto-merge (squash) August 27, 2024 17:03
Cargo.toml Outdated Show resolved Hide resolved
@edmorley
Copy link
Member

Thank you!

@edmorley edmorley merged commit 64eeb1c into main Aug 27, 2024
4 checks passed
@edmorley edmorley deleted the schneems/fix-warn-priority branch August 27, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants