Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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