From f9f3a3502ae4e72783c995ad485ffed1c730ab6e Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:45:38 +0200 Subject: [PATCH] style: consistently place `use eyre::ContextCompat` in location test Fixes https://github.com/eyre-rs/eyre/pull/150#discussion_r1545645111 --- eyre/tests/test_location.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eyre/tests/test_location.rs b/eyre/tests/test_location.rs index 2d199d9..21f4716 100644 --- a/eyre/tests/test_location.rs +++ b/eyre/tests/test_location.rs @@ -100,13 +100,12 @@ fn test_option_ok_or_eyre() { #[cfg(feature = "anyhow")] #[test] fn test_context() { - use eyre::ContextCompat; - let _ = eyre::set_hook(Box::new(|_e| { let expected_location = file!(); Box::new(LocationHandler::new(expected_location)) })); + use eyre::ContextCompat; let err = read_path("totally_fake_path") .context("oopsie") .unwrap_err(); @@ -118,13 +117,12 @@ fn test_context() { #[cfg(feature = "anyhow")] #[test] fn test_with_context() { - use eyre::ContextCompat; - let _ = eyre::set_hook(Box::new(|_e| { let expected_location = file!(); Box::new(LocationHandler::new(expected_location)) })); + use eyre::ContextCompat; let err = read_path("totally_fake_path") .with_context(|| "oopsie") .unwrap_err();