Skip to content

Commit

Permalink
Use fmt::write instead of push_str
Browse files Browse the repository at this point in the history
To make clippy happy
the .unwrap on write! shouldn't fail
  • Loading branch information
Jardynq committed Jul 24, 2022
1 parent 601129a commit ced8cda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Debug for Report {
mod flamegraph {
use super::*;
use inferno::flamegraph;
use std::io::Write;
use std::{fmt::Write as _, io::Write};

impl Report {
/// `flamegraph` will write an svg flamegraph into `writer` **only available with `flamegraph` feature**
Expand Down Expand Up @@ -188,13 +188,13 @@ mod flamegraph {

for frame in key.frames.iter().rev() {
for symbol in frame.iter().rev() {
line.push_str(&format!("{}", symbol));
write!(line, "{}", symbol).unwrap();
line.push(';');
}
}

line.pop().unwrap_or_default();
line.push_str(&format!(" {}", value));
write!(line, " {}", value).unwrap();

line
})
Expand Down

0 comments on commit ced8cda

Please sign in to comment.