Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
ui/utils: Remove useless helper build_string() fn
Matthias Beyer committed 4 months ago
commit dda6a6281aee0a97ba545890ae04b8a7dcdc3d48
parent 42284dc
1 file changed +2 -15
modified src/ui/utils.rs
@@ -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
-
    }
}