ui/utils: Remove useless helper build_string() fn

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer
2025-12-09 13:17:57 +01:00
committed by Erik Kundt
parent 42284dc7d1
commit dda6a6281a
+2 -15
View File
@@ -97,7 +97,7 @@ Is this needed?
HashMap::from([(MergeLocation::Line(2), vec![comment])]),
Some(1),
);
let actual = build_string(merged);
let actual = merged.join("\n");
let expected = r#"
fn main() {
@@ -143,7 +143,7 @@ Is this needed?
HashMap::from([(MergeLocation::Line(103), vec![comment])]),
Some(100),
);
let actual = build_string(merged);
let actual = merged.join("\n");
let expected = r#"
fn main() {
@@ -165,17 +165,4 @@ fn another_function() {
Ok(())
}
fn build_string(lines: Vec<&str>) -> String {
let mut actual = String::new();
for (idx, line) in lines.iter().enumerate() {
if idx == lines.len() - 1 {
actual.push_str(line);
} else {
actual.push_str(&format!("{line}\n"));
}
}
actual
}
}