Skip to content

Commit

Permalink
add sorting discovered IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Chleba committed Apr 15, 2024
1 parent 30e3fbb commit 2119562
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,13 @@ impl Discovery {
mac: String::from(""),
hostname: host,
vendor: String::from(""),
})
});

self.scanned_ips.sort_by(|a, b| {
let a_ip: Ipv4Addr = a.ip.parse::<Ipv4Addr>().unwrap();
let b_ip: Ipv4Addr = b.ip.parse::<Ipv4Addr>().unwrap();
return a_ip.partial_cmp(&b_ip).unwrap();
});
}

self.set_scrollbar_height();
Expand Down

0 comments on commit 2119562

Please sign in to comment.