mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-10-30 16:30:56 +08:00
ui/utils: Remove useless helper build_string() fn
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
committed by
Erik Kundt
parent
42284dc7d1
commit
dda6a6281a
+2
-15
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user