Skip to content

Commit e9d8071

Browse files
committed
add fmt method for BacktraceFmt
1 parent 4e4b7ac commit e9d8071

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/print.rs

+8
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
9595
pub fn message(&mut self, msg: &str) -> fmt::Result {
9696
self.fmt.write_str(msg)
9797
}
98+
99+
/// Return the inner formatter.
100+
///
101+
/// This is used for writing custom information between frames with `write!` and `writeln!`,
102+
/// and won't increment the `frame_index` unlike the `frame` method.
103+
pub fn fmt(&mut self) -> &mut fmt::Formatter<'b> {
104+
self.fmt
105+
}
98106
}
99107

100108
/// A formatter for just one frame of a backtrace.

0 commit comments

Comments
 (0)