Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
bin/ui: Simplify collecting of children vec
Matthias Beyer committed 5 months ago
commit 02dc8e9a3434e0a4ef7fa09db429f62822443b72
parent d52dca76b60490027ac059eb6b0706c5282f8f1c
1 file changed +1 -4
modified bin/ui/items.rs
@@ -688,10 +688,7 @@ impl CommentItem {

impl ToTree<String> for CommentItem {
    fn rows(&self) -> Vec<TreeItem<'_, String>> {
-
        let mut children = vec![];
-
        for comment in &self.replies {
-
            children.extend(comment.rows());
-
        }
+
        let children = self.replies.iter().flat_map(CommentItem::rows).collect();

        let author = match &self.author.alias {
            Some(alias) => {