Skip to content

Commit 21f8f89

Browse files
committed
Use fmt::write instead of push_str
To make clippy happy the .unwrap on write! shouldn't fail Signed-off-by: Christian Jordan <[email protected]>
1 parent 0dc0332 commit 21f8f89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/report.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Debug for Report {
159159
mod flamegraph {
160160
use super::*;
161161
use inferno::flamegraph;
162-
use std::io::Write;
162+
use std::{fmt::Write as _, io::Write};
163163

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

189189
for frame in key.frames.iter().rev() {
190190
for symbol in frame.iter().rev() {
191-
line.push_str(&format!("{}", symbol));
191+
write!(line, "{}", symbol).unwrap();
192192
line.push(';');
193193
}
194194
}
195195

196196
line.pop().unwrap_or_default();
197-
line.push_str(&format!(" {}", value));
197+
write!(line, " {}", value).unwrap();
198198

199199
line
200200
})

0 commit comments

Comments
 (0)