aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-08-04 17:17:36 +0200
committerache <ache@ache.one>2026-08-04 17:17:36 +0200
commitb2d4f1d436187e132a7182ed07c446ecfe32320c (patch)
tree49a4429fcd2253ea65ba2f0e02fe8eb6137e35b6 /src/main.rs
parentPrint stats (diff)
Remove dead print_last_line
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
1 files changed, 9 insertions, 9 deletions
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);
+ }
}