33#![ allow( deprecated) ] // for PanicHook until we bump MSRV
44use crate :: {
55 section:: PanicMessage ,
6- style_if_possible ,
6+ style ,
77 writers:: { EnvSection , WriterExt } ,
88} ;
99use fmt:: Display ;
@@ -194,12 +194,12 @@ impl fmt::Display for StyledFrame<'_> {
194194 } ;
195195
196196 if is_dependency_code {
197- write ! ( f, "{}" , style_if_possible ( name, theme. dependency_code) ) ?;
197+ write ! ( f, "{}" , style ( name, theme. dependency_code) ) ?;
198198 } else {
199- write ! ( f, "{}" , style_if_possible ( name, theme. crate_code) ) ?;
199+ write ! ( f, "{}" , style ( name, theme. crate_code) ) ?;
200200 }
201201
202- write ! ( f, "{}" , style_if_possible ( hash_suffix, theme. code_hash) ) ?;
202+ write ! ( f, "{}" , style ( hash_suffix, theme. code_hash) ) ?;
203203
204204 let mut separated = f. header ( "\n " ) ;
205205
@@ -216,8 +216,8 @@ impl fmt::Display for StyledFrame<'_> {
216216 write ! (
217217 & mut separated. ready( ) ,
218218 " at {}:{}" ,
219- style_if_possible ( file, theme. file) ,
220- style_if_possible ( lineno, theme. line_number) ,
219+ style ( file, theme. file) ,
220+ style ( lineno, theme. line_number) ,
221221 ) ?;
222222
223223 let v = if std:: thread:: panicking ( ) {
@@ -268,9 +268,9 @@ impl fmt::Display for SourceSection<'_> {
268268 write ! (
269269 & mut f,
270270 "{:>8} {} {}" ,
271- style_if_possible ( cur_line_no, theme. active_line) ,
272- style_if_possible ( ">" , theme. active_line) ,
273- style_if_possible ( line, theme. active_line) ,
271+ style ( cur_line_no, theme. active_line) ,
272+ style ( ">" , theme. active_line) ,
273+ style ( line, theme. active_line) ,
274274 ) ?;
275275 } else {
276276 write ! ( & mut f, "{cur_line_no:>8} │ {line}" ) ?;
@@ -799,7 +799,7 @@ impl PanicMessage for DefaultPanicMessage {
799799 writeln ! (
800800 f,
801801 "{}" ,
802- style_if_possible ( "The application panicked (crashed)." , theme. panic_header)
802+ style ( "The application panicked (crashed)." , theme. panic_header)
803803 ) ?;
804804
805805 // Print panic message.
@@ -811,7 +811,7 @@ impl PanicMessage for DefaultPanicMessage {
811811 . unwrap_or ( "<non string panic payload>" ) ;
812812
813813 write ! ( f, "Message: " ) ?;
814- writeln ! ( f, "{}" , style_if_possible ( payload, theme. panic_message) ) ?;
814+ writeln ! ( f, "{}" , style ( payload, theme. panic_message) ) ?;
815815
816816 // If known, print panic location.
817817 write ! ( f, "Location: " ) ?;
@@ -1132,7 +1132,7 @@ impl fmt::Display for BacktraceFormatter<'_> {
11321132 write!(
11331133 & mut separated. ready( ) ,
11341134 "{:^80}" ,
1135- style_if_possible ( & buf, self . theme. hidden_frames)
1135+ style ( & buf, self . theme. hidden_frames)
11361136 ) ?;
11371137 } ;
11381138 }
0 commit comments