8000 Fix compile warnings when `trace` feature is disabled by Malax · Pull Request #766 · heroku/libcnb.rs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix compile warnings when trace feature is disabled #766

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

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Conversation

Malax
Copy link
Member
@Malax Malax commented Jan 31, 2024

When the trace feature is disabled, several warnings will be emitted during compilation. These warnings started to appear after #723 was merged.

warning: unused variable: `err`
   --> libcnb/src/runtime.rs:135:28
    |
135 |     let mut trace_error = |err: &dyn std::error::Error| {
    |                            ^^^ help: if this is intentional, prefix it with an underscore: `_err`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: variable does not need to be mutable
   --> libcnb/src/runtime.rs:135:9
    |
135 |     let mut trace_error = |err: &dyn std::error::Error| {
    |         ----^^^^^^^^^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: unused variable: `err`
   --> libcnb/src/runtime.rs:209:28
    |
209 |     let mut trace_error = |err: &dyn std::error::Error| {
    |                            ^^^ help: if this is intentional, prefix it with an underscore: `_err`

warning: variable does not need to be mutable
   --> libcnb/src/runtime.rs:209:9
    |
209 |     let mut trace_error = |err: &dyn std::error::Error| {
    |         ----^^^^^^^^^^^
    |         |
    |         help: remove this `mut`

warning: `libcnb` (lib) generated 4 warnings (run `cargo fix --lib -p libcnb` to apply 4 suggestions)

This PR fixes those.

@Malax Malax requested a review from a team as a code owner January 31, 2024 11:26
Copy link
Member
@edmorley edmorley left a comment

Choose a reason for hiding this comment

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

Thank you - these were bugging me in CI logs.

(Once Rust 1.76 is released in Feb we can also switch to inspect_err which will clean up some of the rest of this handling)

@Malax Malax merged commit 45d4c2c into main Jan 31, 2024
@Malax Malax deleted the malax/fix-warnings branch January 31, 2024 12:14
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
0