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

subscriber: fix clippy lints #636

Merged
merged 2 commits into from
Mar 13, 2020
Merged

subscriber: fix clippy lints #636

merged 2 commits into from
Mar 13, 2020

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Mar 13, 2020

Motivation

Looks like Clippy is once again complaining about the
match_wild_err_arm lint, presumably as a result of the Rust 1.42
release. This lint triggers on the try_lock! macro that
tracing-subscriber uses to avoid double panics when a mutex is
poisoned. In this case, the lint is something of a false positive here,
since we do actually have two different Err(...) arms; the
differentiation between the two arms is not in the match pattern but in
a guard. See rust-lang/rust-clippy#3688 for
details on the lint.

Solution

I've refactored the code in question to use if/else, avoiding the
lint.

Signed-off-by: Eliza Weisman eliza@buoyant.io

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw added kind/bug Something isn't working crate/subscriber Related to the `tracing-subscriber` crate labels Mar 13, 2020
@hawkw hawkw requested a review from a team March 13, 2020 19:23
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw merged commit 77624f0 into master Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/subscriber Related to the `tracing-subscriber` crate kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants