Skip to content

Commit 11844d7

Browse files
keepsimple1kaffarell
authored andcommitted
chore: fix clippy warnings for v0.1.x (tokio-rs#2552)
## Motivation Clippy check fails in recent CI runs in v0.1.x branch PRs, for example this run: https://github.com/tokio-rs/tracing/actions/runs/4641107803/jobs/8215263838 Relevant error logs: ``` error: lint `const_err` has been removed: converted into hard error, see issue #71800 <rust-lang/rust#71800> for more information --> tracing-core/src/lib.rs:132:5 | 132 | const_err, | ^^^^^^^^^ | = note: `-D renamed-and-removed-lints` implied by `-D warnings` error: deref which would be done by auto-deref --> tracing-core/src/dispatcher.rs:371:26 | 371 | return f(&*entered.current()); | ^^^^^^^^^^^^^^^^^^^ help: try this: `&entered.current()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `-D clippy::explicit-auto-deref` implied by `-D warnings` error: deref which would be done by auto-deref --> tracing-core/src/dispatcher.rs:393:20 | 393 | Some(f(&*entered.current())) | ^^^^^^^^^^^^^^^^^^^ help: try this: `&entered.current()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref ``` ## Solution Fix the warnings based on the suggestions for Clippy.
1 parent 3149fb1 commit 11844d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tracing-core/src/dispatcher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ where
368368
CURRENT_STATE
369369
.try_with(|state| {
370370
if let Some(entered) = state.enter() {
371-
return f(&*entered.current());
371+
return f(&entered.current());
372372
}
373373

374374
f(&Dispatch::none())
@@ -390,7 +390,7 @@ pub fn get_current<T>(f: impl FnOnce(&Dispatch) -> T) -> Option<T> {
390390
CURRENT_STATE
391391
.try_with(|state| {
392392
let entered = state.enter()?;
393-
Some(f(&*entered.current()))
393+
Some(f(&entered.current()))
394394
})
395395
.ok()?
396396
}

0 commit comments

Comments
 (0)