tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.19k stars 677 forks source link

attributes: extract match scrutinee #2880

Closed kaffarell closed 4 months ago

kaffarell commented 5 months ago

On clippy version 1.76.0 this gives a warning, extracting the scrutinee to a variable fixes this.

Fixes: #2876

kaffarell commented 5 months ago

Huh, which warning does this generate?

This one: https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions (although the description here is a little bit out of date, it doesn't apply only to if's anymore fixed it) The full clippy output is also in the issue linked :)

seanpianka commented 4 months ago

@kaffarell Can you rebase your changes with the latest trunk? This lint in your fork https://github.com/kaffarell/tracing/blob/v0.1.x/tracing-core/src/lib.rs#L138 is deprecated and has been replaced/updated on the trunk: https://github.com/tokio-rs/tracing/blob/master/tracing-core/src/lib.rs#L155.

This should make this PR ready to merge and ready to remove the 300+ warnings I have in one of my projects 😄

kaffarell commented 4 months ago

@seanpianka rebased it ontop latest v0.1.x!

seanpianka commented 4 months ago

Thank you! @hawkw We should be good to go 🙂