From f3876b47459a4b67030589a1e7e8924ec7ce0084 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 11 Mar 2021 12:22:28 +0100 Subject: [PATCH] Remove instance filtering/sorting --- src/main.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index bdb75a7..e1a2d3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,10 +12,9 @@ const START_INSTANCES: [&'static str; 1] = ["lemmy.ml"]; #[tokio::main] pub async fn main() -> Result<(), Error> { let start_instances = START_INSTANCES.iter().map(|s| s.to_string()).collect(); - + eprintln!("Crawling..."); let instance_details = crawl(start_instances).await?; - let instance_details = cleanup(instance_details); let total_stats = aggregate(instance_details); println!("{}", serde_json::to_string(&total_stats)?); @@ -47,16 +46,6 @@ fn aggregate(instance_details: Vec) -> TotalStats { } } -fn cleanup(instance_details: Vec) -> Vec { - let mut instance_details: Vec = instance_details - .iter() - .filter(|i| i.open_registrations) - .map(|i| i.to_owned()) - .collect(); - instance_details.sort_by(|a, b| b.users_active_halfyear.cmp(&a.users_active_halfyear)); - instance_details -} - async fn crawl(start_instances: Vec) -> Result, Error> { let mut pending_instances = start_instances; let mut instance_details = vec![];