Skip to content

Commit 1666a4d

Browse files
authored
fix inconsistent behavior (#1)
1 parent 9a38e54 commit 1666a4d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ color-backtrace = "0.4.0"
1818
backtrace = "0.3"
1919
indenter = "0.2.0"
2020
ansi_term = "0.12.1"
21-
color-spantrace = { version = "0.1", optional = true }
21+
color-spantrace = { version = "0.1.1", optional = true }
22+
2223

2324
[dev-dependencies]
2425
tracing-subscriber = "0.2.5"

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ pub struct Context {
178178
impl EyreContext for Context {
179179
#[allow(unused_variables)]
180180
fn default(error: &(dyn std::error::Error + 'static)) -> Self {
181-
let backtrace = if std::env::var("RUST_LIB_BACKTRACE").is_ok() {
181+
let backtrace = if std::env::var("RUST_LIB_BACKTRACE")
182+
.or_else(|_| std::env::var("RUST_BACKTRACE"))
183+
.is_ok()
184+
{
182185
Some(Backtrace::new())
183186
} else {
184187
None

0 commit comments

Comments
 (0)