From 2fc09f47caddd880b5935a68ce3d40cdb545d1c5 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 16 Jun 2023 08:24:06 -0700 Subject: [PATCH] chore: silence `clippy::redundant_clone` warning (#2619) The purpose of this test is to assert two clones of the same span are equal to each other, so the clone is kind of the whole point of the test. This commit adds an allow attribute to make clippy shut up about it. --- tracing/tests/span.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tracing/tests/span.rs b/tracing/tests/span.rs index ad71b17a8c..14c4417cb6 100644 --- a/tracing/tests/span.rs +++ b/tracing/tests/span.rs @@ -21,7 +21,12 @@ fn handles_to_the_same_span_are_equal() { // expect to see any spans. with_default(collector::mock().run(), || { let foo1 = tracing::span!(Level::TRACE, "foo"); + + // The purpose of this test is to assert that two clones of the same + // span are equal, so the clone here is kind of the whole point :) + #[allow(clippy::redundant_clone)] let foo2 = foo1.clone(); + // Two handles that point to the same span are equal. assert_eq!(foo1, foo2); });