Skip to content

Commit e7dcc62

Browse files
Merge pull request #532 from chenyukang/yukang-add-fmt
Add fmt method for BacktraceFmt
2 parents 1d97a00 + 5724d61 commit e7dcc62

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 formatter(&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)