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 646d4360e7d905f0a9ec87d32c6768c5390eabf3
parent 2f2823267673af9e6f04a7a2ec32ce9784db8007
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))
}