From b2d4f1d436187e132a7182ed07c446ecfe32320c Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 4 Aug 2026 17:17:36 +0200 Subject: Remove dead print_last_line --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index f6ac365..e2c179e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ mod stats; use args::Args; use ip::parse_ip; use pinger::{spawn_ping, PingResult}; -use print::{print_last_ping_line, print_legende_line, print_ping_line, print_stats}; +use print::{print_legende_line, print_ping_line, print_stats}; use state::State; use stats::compute_stats; @@ -108,14 +108,14 @@ async fn main() { print_stats(&stats); } // Print stats of the last 30 pings - // let firstIndex = if states.len() - 30 > 0 { - // states.len() - 30 - // } else { - // 0 - // }; - // if let Some(stats) = compute_stats(&states[firstIndex..]) { - // print_stats(&stats); - // } + let firstIndex = if (states.len() as i32) - 30 > 0 { + states.len() - 30 + } else { + 0 + }; + if let Some(stats) = compute_stats(&states[firstIndex..]) { + print_stats(&stats); + } } -- cgit v1.3-2-g11bf