Skip to content

Commit

Permalink
chore: refactor backtrace formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Konippi committed Aug 1, 2024
1 parent c0e3298 commit 45d35ba
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions library/std/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,8 @@ where
}

if self.show_backtrace {
let backtrace = self.backtrace();

if let Some(backtrace) = backtrace {
let backtrace = backtrace.to_string();

f.write_str("\n\nStack backtrace:\n")?;
f.write_str(backtrace.trim_end())?;
if let Some(backtrace) = self.backtrace() {
write!(f, "\n\nStack backtrace:\n{}", backtrace.to_string().trim_end())?;
}
}

Expand Down

0 comments on commit 45d35ba

Please sign in to comment.