Skip to content

Commit 8375e0c

Browse files
committed
docs: Use inline format args
1 parent e4efef9 commit 8375e0c

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

examples/highlight_message.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,8 @@ fn main() {
2929
.on_default()
3030
.effects(Effects::BOLD);
3131
let message = format!(
32-
"expected fn pointer `{}for<'a>{} fn(Box<{}(dyn Any + Send + 'a){}>) -> Pin<_>`
33-
found fn item `fn(Box<{}(dyn Any + Send + 'static){}>) -> Pin<_> {}{{wrapped_fn}}{}`",
34-
magenta.render(),
35-
magenta.render_reset(),
36-
magenta.render(),
37-
magenta.render_reset(),
38-
magenta.render(),
39-
magenta.render_reset(),
40-
magenta.render(),
41-
magenta.render_reset()
32+
"expected fn pointer `{magenta}for<'a>{magenta:#} fn(Box<{magenta}(dyn Any + Send + 'a){magenta:#}>) -> Pin<_>`
33+
found fn item `fn(Box<{magenta}(dyn Any + Send + 'static){magenta:#}>) -> Pin<_> {magenta}{{wrapped_fn}}{magenta:#}`",
4234
);
4335

4436
let message = &[

src/renderer/styled_buffer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ impl StyledBuffer {
5151
let ch_style = style.color_spec(level, stylesheet);
5252
if ch_style != current_style {
5353
if !line.is_empty() {
54-
write!(str, "{}", current_style.render_reset())?;
54+
write!(str, "{current_style:#}")?;
5555
}
5656
current_style = ch_style;
57-
write!(str, "{}", current_style.render())?;
57+
write!(str, "{current_style}")?;
5858
}
5959
write!(str, "{ch}")?;
6060
}
61-
write!(str, "{}", current_style.render_reset())?;
61+
write!(str, "{current_style:#}")?;
6262
if i != self.lines.len() - 1 {
6363
writeln!(str)?;
6464
}

0 commit comments

Comments
 (0)