Skip to content

Commit 7d25da0

Browse files
committed
Fix center pad sometimes being added multiple times
1 parent dad9449 commit 7d25da0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/info.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ impl std::fmt::Display for Info {
169169
)?;
170170

171171
let center_pad = " ";
172-
let mut info_lines = buf.lines().map(|s| format!("{}{}", center_pad, s));
172+
let mut info_lines = buf.lines();
173173

174174
if let Some(custom_image) = &self.custom_image {
175175
if let Some(backend) = image_backends::get_best_backend() {
176-
writeln!(f, "{}", backend.add_image(info_lines.collect(), custom_image))?;
176+
writeln!(f, "{}", backend.add_image(info_lines.map(|s| format!("{}{}", center_pad, s)).collect(), custom_image))?;
177177
} else {
178178
panic!("No image backend found")
179179
}

0 commit comments

Comments
 (0)