Skip to content

Commit

Permalink
Unrolled build for rust-lang#128499
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#128499 - Konippi:refactor-backtrace-formatting, r=tgross35

chore: refactor backtrace formatting

Replace `write_str()` with the `writeln!()` macro, consolidating multiple write operations.
  • Loading branch information
rust-timer authored Aug 1, 2024
2 parents e60ebb2 + 45d35ba commit 9452b29
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 9452b29

Please sign in to comment.