Skip to content

Commit

Permalink
clippy: Suppress borrow warning in ErrorRef test
Browse files Browse the repository at this point in the history
The weird borrowing magic is part of the point (PR #328)
  • Loading branch information
Techcable committed Jan 3, 2024
1 parent 9b9e628 commit 586519a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3388,7 +3388,14 @@ fn test_error_tag_wrapper() {
}
impl std::error::Error for MyError {}
let e = MyError("everything is on fire");
assert_eq!((&&ErrorTagWrapper(e)).slog_error_kind(), ErrorValueTag);
assert_eq!(
{
#[allow(clippy::needless_borrow)]
// The "needless" borrow is part of the point
(&&ErrorTagWrapper(e)).slog_error_kind()
},
ErrorValueTag
);
let e = &e;
assert_eq!((&&ErrorTagWrapper(e)).slog_error_kind(), ErrorRefTag);
}
Expand Down

0 comments on commit 586519a

Please sign in to comment.