Skip to content

Commit cc75cbd

Browse files
committed
Remove more clippy allows
1 parent 924bbac commit cc75cbd

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

examples/examples/fmt/yak_shave.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ pub fn shave(yak: usize) -> Result<(), Box<dyn Error + 'static>> {
1212
);
1313
if yak == 3 {
1414
warn!(target: "yak_events", "could not locate yak!");
15-
#[allow(clippy::try_err)]
16-
Err(ShaveError::new(yak, YakError::new("could not locate yak")))?;
15+
return Err(ShaveError::new(yak, YakError::new("could not locate yak")).into());
1716
} else {
1817
trace!(target: "yak_events", "yak shaved successfully");
1918
}

tracing-core/src/metadata.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ pub struct Level(LevelInner);
9191
impl<'a> Metadata<'a> {
9292
/// Construct new metadata for a span or event, with a name, target, level, field
9393
/// names, and optional source code location.
94-
#[allow(clippy::too_many_arguments)]
9594
pub const fn new(
9695
name: &'static str,
9796
target: &'a str,

tracing-subscriber/src/filter/env/directive.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,9 @@ impl<T: Match + Ord> DirectiveSet<T> {
415415
.filter(move |d| d.cares_about(metadata))
416416
}
417417

418-
#[allow(clippy::op_ref)]
419418
pub(crate) fn add(&mut self, directive: T) {
420419
let level = directive.level();
421-
if level > &self.max_level {
420+
if *level > self.max_level {
422421
self.max_level = level.clone();
423422
}
424423
let _ = self.directives.replace(directive);
@@ -434,12 +433,11 @@ impl<T: Match + Ord> FromIterator<T> for DirectiveSet<T> {
434433
}
435434

436435
impl<T: Match + Ord> Extend<T> for DirectiveSet<T> {
437-
#[allow(clippy::op_ref)]
438436
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
439437
let max_level = &mut self.max_level;
440438
let ds = iter.into_iter().inspect(|d| {
441439
let level = d.level();
442-
if level > &*max_level {
440+
if *level > *max_level {
443441
*max_level = level.clone();
444442
}
445443
});
@@ -450,7 +448,6 @@ impl<T: Match + Ord> Extend<T> for DirectiveSet<T> {
450448
// === impl Dynamics ===
451449

452450
impl Dynamics {
453-
#[allow(clippy::op_ref)]
454451
pub(crate) fn matcher(&self, metadata: &Metadata<'_>) -> Option<CallsiteMatcher> {
455452
let mut base_level = None;
456453
let field_matches = self
@@ -460,7 +457,7 @@ impl Dynamics {
460457
return Some(f);
461458
}
462459
match base_level {
463-
Some(ref b) if &d.level > b => base_level = Some(d.level.clone()),
460+
Some(ref b) if d.level > *b => base_level = Some(d.level.clone()),
464461
None => base_level = Some(d.level.clone()),
465462
_ => {}
466463
}

tracing-subscriber/src/fmt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ where
413413
{
414414
/// Configures the subscriber being built to allow filter reloading at
415415
/// runtime.
416-
#[allow(clippy::type_complexity)]
417416
pub fn with_filter_reloading(
418417
self,
419418
) -> SubscriberBuilder<N, E, crate::reload::Layer<crate::EnvFilter, Formatter<N, E, W>>, W>

tracing-subscriber/src/layer.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ where
506506
self.try_close(id);
507507
}
508508

509-
#[allow(clippy::option_map_unit_fn)]
510509
fn try_close(&self, id: span::Id) -> bool {
511510
#[cfg(feature = "registry")]
512511
let subscriber = &self.inner as &dyn Subscriber;
@@ -518,7 +517,11 @@ where
518517
// If we have a registry's close guard, indicate that the span is
519518
// closing.
520519
#[cfg(feature = "registry")]
521-
guard.as_mut().map(|g| g.is_closing());
520+
{
521+
if let Some(g) = guard.as_mut() {
522+
g.is_closing()
523+
};
524+
}
522525

523526
self.layer.on_close(id, self.ctx());
524527
true

0 commit comments

Comments
 (0)