Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli/node: Replace manual pushing with Table::extend()
Matthias Beyer committed 7 months ago
commit 87ebda8c0b6062cab0ce22670865464983b2c3fd
parent f357d58d81a674e0a226b541cbb7c23698c006e3
1 file changed +5 -3
modified crates/radicle-cli/src/commands/node/control.rs
@@ -375,7 +375,7 @@ pub fn sessions(node: &Node) -> Result<Option<term::Table<5, term::Label>>, node
    ]);
    table.divider();

-
    for sess in sessions {
+
    table.extend(sessions.into_iter().map(|sess| {
        let nid = term::format::tertiary(term::format::node_id_human(&sess.nid)).into();
        let (addr, state, time) = match sess.state {
            node::State::Initial => (
@@ -403,8 +403,10 @@ pub fn sessions(node: &Node) -> Result<Option<term::Table<5, term::Label>>, node
            node::Link::Inbound => term::Label::from(link_direction_inbound()),
            node::Link::Outbound => term::Label::from(link_direction_outbound()),
        };
-
        table.push([nid, addr, state, direction, time]);
-
    }
+

+
        [nid, addr, state, direction, time]
+
    }));
+

    Ok(Some(table))
}