From 6e5d94c63227246dd8a34a7283fa4e428cb7336f Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Sat, 19 Mar 2022 07:43:15 +0100 Subject: [PATCH] ui: removed redundant is_empty check --- bin/dnetview/src/ui.rs | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/bin/dnetview/src/ui.rs b/bin/dnetview/src/ui.rs index 08e5a2960..3f84fef0c 100644 --- a/bin/dnetview/src/ui.rs +++ b/bin/dnetview/src/ui.rs @@ -55,23 +55,21 @@ pub fn ui(f: &mut Frame<'_, B>, mut view: View) { data.push("Incoming".to_string()); } for inbound in &node.inbound { - if inbound.is_empty == false { - let addr = Span::styled(format!(" {}", inbound.connected), style); - data.push(format!("{}", inbound.connected)); - let msg: Span = match inbound.channel.last_status.as_str() { - "recv" => Span::styled( - format!(" [R: {}]", inbound.channel.last_msg), - style, - ), - "sent" => Span::styled( - format!(" [R: {}]", inbound.channel.last_msg), - style, - ), - a => Span::styled(a.to_string(), style), - }; - data.push(format!("{}", inbound.channel.last_msg)); - lines.push(Spans::from(vec![addr, msg])); - } + let addr = Span::styled(format!(" {}", inbound.connected), style); + data.push(format!("{}", inbound.connected)); + let msg: Span = match inbound.channel.last_status.as_str() { + "recv" => Span::styled( + format!(" [R: {}]", inbound.channel.last_msg), + style, + ), + "sent" => Span::styled( + format!(" [R: {}]", inbound.channel.last_msg), + style, + ), + a => Span::styled(a.to_string(), style), + }; + data.push(format!("{}", inbound.channel.last_msg)); + lines.push(Spans::from(vec![addr, msg])); } lines.push(Spans::from(Span::styled(" Manual", Style::default()))); data.push("Manual".to_string());