mirror of
https://github.com/tokio-rs/tracing.git
synced 2026-01-25 04:16:18 +00:00
chore: track Rust 1.65 clippy lints (#2366)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
blacklisted-names = []
|
||||
disallowed-names = []
|
||||
cognitive-complexity-threshold = 100
|
||||
too-many-arguments-threshold = 8
|
||||
type-complexity-threshold = 375
|
||||
|
||||
@@ -135,7 +135,7 @@ fn gen_block<B: ToTokens>(
|
||||
.into_iter()
|
||||
.flat_map(|param| match param {
|
||||
FnArg::Typed(PatType { pat, ty, .. }) => {
|
||||
param_names(*pat, RecordType::parse_from_ty(&*ty))
|
||||
param_names(*pat, RecordType::parse_from_ty(&ty))
|
||||
}
|
||||
FnArg::Receiver(_) => Box::new(iter::once((
|
||||
Ident::new("self", param.span()),
|
||||
|
||||
@@ -475,7 +475,7 @@ pub fn get_current<T>(f: impl FnOnce(&Dispatch) -> T) -> Option<T> {
|
||||
CURRENT_STATE
|
||||
.try_with(|state| {
|
||||
let entered = state.enter()?;
|
||||
Some(f(&*entered.current()))
|
||||
Some(f(&entered.current()))
|
||||
})
|
||||
.ok()?
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ impl MultithreadedBench {
|
||||
thread::spawn(move || {
|
||||
let dispatch = this.dispatch.clone();
|
||||
tracing::dispatch::with_default(&dispatch, move || {
|
||||
f(&*this.start);
|
||||
f(&this.start);
|
||||
this.end.wait();
|
||||
})
|
||||
});
|
||||
|
||||
@@ -681,7 +681,7 @@ mod test {
|
||||
);
|
||||
|
||||
let span = tracing::info_span!("the span", na = tracing::field::Empty);
|
||||
span.record("na", &"value");
|
||||
span.record("na", "value");
|
||||
let _enter = span.enter();
|
||||
|
||||
tracing::info!("an event inside the root span");
|
||||
|
||||
@@ -418,7 +418,7 @@ impl<'a> SpanData<'a> for Data<'a> {
|
||||
}
|
||||
|
||||
fn metadata(&self) -> &'static Metadata<'static> {
|
||||
(*self).inner.metadata
|
||||
self.inner.metadata
|
||||
}
|
||||
|
||||
fn parent(&self) -> Option<&Id> {
|
||||
@@ -898,7 +898,7 @@ mod tests {
|
||||
|
||||
drop(span3);
|
||||
|
||||
state.assert_closed_in_order(&["child", "parent", "grandparent"]);
|
||||
state.assert_closed_in_order(["child", "parent", "grandparent"]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ fn record_after_created() {
|
||||
tracing::debug!("i'm disabled!");
|
||||
});
|
||||
|
||||
span.record("enabled", &true);
|
||||
span.record("enabled", true);
|
||||
span.in_scope(|| {
|
||||
tracing::debug!("i'm enabled!");
|
||||
});
|
||||
|
||||
@@ -1604,7 +1604,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_record_backwards_compat() {
|
||||
Span::current().record("some-key", &"some text");
|
||||
Span::current().record("some-key", &false);
|
||||
Span::current().record("some-key", "some text");
|
||||
Span::current().record("some-key", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ fn record_new_value_for_field() {
|
||||
|
||||
with_default(collector, || {
|
||||
let span = tracing::span!(Level::TRACE, "foo", bar = 5, baz = false);
|
||||
span.record("baz", &true);
|
||||
span.record("baz", true);
|
||||
span.in_scope(|| {})
|
||||
});
|
||||
|
||||
@@ -598,8 +598,8 @@ fn record_new_values_for_fields() {
|
||||
|
||||
with_default(collector, || {
|
||||
let span = tracing::span!(Level::TRACE, "foo", bar = 4, baz = false);
|
||||
span.record("bar", &5);
|
||||
span.record("baz", &true);
|
||||
span.record("bar", 5);
|
||||
span.record("baz", true);
|
||||
span.in_scope(|| {})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user