From 90645efddcefa475a37608184cb3a699685ffc65 Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Fri, 29 Mar 2024 10:51:15 +0100 Subject: [PATCH] fix: warnings from new clippy lints --- eyre/src/lib.rs | 6 +++--- eyre/tests/test_location.rs | 2 -- eyre/tests/test_repr.rs | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/eyre/src/lib.rs b/eyre/src/lib.rs index 65b3980..1c5231f 100644 --- a/eyre/src/lib.rs +++ b/eyre/src/lib.rs @@ -624,7 +624,7 @@ fn capture_handler(error: &(dyn StdError + 'static)) -> Box { } impl dyn EyreHandler { - /// + /// Check if the handler is of type `T` pub fn is(&self) -> bool { // Get `TypeId` of the type this function is instantiated with. let t = core::any::TypeId::of::(); @@ -636,7 +636,7 @@ impl dyn EyreHandler { t == concrete } - /// + /// Downcast the handler to a contcrete type `T` pub fn downcast_ref(&self) -> Option<&T> { if self.is::() { unsafe { Some(&*(self as *const dyn EyreHandler as *const T)) } @@ -645,7 +645,7 @@ impl dyn EyreHandler { } } - /// + /// Downcast the handler to a contcrete type `T` pub fn downcast_mut(&mut self) -> Option<&mut T> { if self.is::() { unsafe { Some(&mut *(self as *mut dyn EyreHandler as *mut T)) } diff --git a/eyre/tests/test_location.rs b/eyre/tests/test_location.rs index 63f8709..2d199d9 100644 --- a/eyre/tests/test_location.rs +++ b/eyre/tests/test_location.rs @@ -107,7 +107,6 @@ fn test_context() { Box::new(LocationHandler::new(expected_location)) })); - use eyre::WrapErr; let err = read_path("totally_fake_path") .context("oopsie") .unwrap_err(); @@ -126,7 +125,6 @@ fn test_with_context() { Box::new(LocationHandler::new(expected_location)) })); - use eyre::WrapErr; let err = read_path("totally_fake_path") .with_context(|| "oopsie") .unwrap_err(); diff --git a/eyre/tests/test_repr.rs b/eyre/tests/test_repr.rs index 71a5663..5a1b5bf 100644 --- a/eyre/tests/test_repr.rs +++ b/eyre/tests/test_repr.rs @@ -4,7 +4,6 @@ mod drop; use self::common::maybe_install_handler; use self::drop::{DetectDrop, Flag}; use eyre::Report; -use std::marker::Unpin; use std::mem; #[test]