Skip to content

Commit

Permalink
chore: silence clippy::redundant_clone warning (#2619)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hawkw authored Jun 16, 2023
1 parent 3bde225 commit 2fc09f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tracing/tests/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 2fc09f4

Please sign in to comment.