Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into color-eyre
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Mar 14, 2024
2 parents cb4bab6 + 75beaae commit eb8d059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion color-spantrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version = { workspace = true }
[dependencies]
tracing-error = "0.2.0"
tracing-core = "0.1.21"
owo-colors = { workspace = true }
owo-colors = "4.0"
once_cell = { workspace = true }

[dev-dependencies]
Expand Down
7 changes: 4 additions & 3 deletions eyre/tests/test_location.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::panic::Location;

use eyre::WrapErr;

struct LocationHandler {
actual: Option<&'static str>,
expected: &'static str,
Expand Down Expand Up @@ -46,6 +44,7 @@ fn test_wrap_err() {
Box::new(LocationHandler::new(expected_location))
}));

use eyre::WrapErr;
let err = read_path("totally_fake_path")
.wrap_err("oopsie")
.unwrap_err();
Expand Down Expand Up @@ -75,6 +74,7 @@ fn test_wrap_err_with() {
Box::new(LocationHandler::new(expected_location))
}));

use eyre::WrapErr;
let err = read_path("totally_fake_path")
.wrap_err_with(|| "oopsie")
.unwrap_err();
Expand All @@ -83,7 +83,6 @@ fn test_wrap_err_with() {
println!("{:?}", err);
}

#[cfg(feature = "anyhow")]
#[test]
fn test_option_ok_or_eyre() {
let _ = eyre::set_hook(Box::new(|_e| {
Expand All @@ -106,6 +105,7 @@ fn test_context() {
Box::new(LocationHandler::new(expected_location))
}));

use eyre::WrapErr;
let err = read_path("totally_fake_path")
.context("oopsie")
.unwrap_err();
Expand All @@ -122,6 +122,7 @@ 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();
Expand Down

0 comments on commit eb8d059

Please sign in to comment.