Skip to content

Commit

Permalink
fix: chart display sort (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang authored Jan 25, 2025
1 parent d7ee363 commit 64278af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}


let targets: Vec<String> = args.target.into_iter().collect::<HashSet<_>>().into_iter().collect();
// after de-duplication, the original order is still preserved
let mut seen = HashSet::new();
let targets: Vec<String> = args.target.into_iter()
.filter(|item| seen.insert(item.clone()))
.collect();

let res = run_app(targets, args.count, args.interval, running.clone(), args.force_ipv6, args.multiple, args.view_type).await;

Expand Down

0 comments on commit 64278af

Please sign in to comment.