From c50dc621218bf657e1b085859f3478e5f32f3a77 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Mon, 22 Aug 2022 21:27:27 +0100 Subject: [PATCH] beep --- src/cmd_check_missing.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/cmd_check_missing.rs b/src/cmd_check_missing.rs index d5921c8..543ff6b 100644 --- a/src/cmd_check_missing.rs +++ b/src/cmd_check_missing.rs @@ -40,7 +40,7 @@ pub async fn check_missing(args: CheckMissingArgs) { let total_missing: Vec = HashMap::::from_iter( missing_stickers .iter() - .map(|(_, stickers)| stickers.clone()) + .map(|(_pack_name, stickers)| stickers.clone()) .collect::>>() .concat() .iter() @@ -49,9 +49,21 @@ pub async fn check_missing(args: CheckMissingArgs) { .into_keys() .collect(); + let missing_from_all: Vec<&String> = total_missing + .iter() + .filter(|missing_sticker| { + return missing_stickers + .iter() + .map(|(_pack_name, stickers)| stickers.contains(missing_sticker)) + .any(|x| !x); + }) + .collect(); + for (pack_name, stickers) in missing_stickers.iter() { println!("Pack: {}\nMissing: {:#?}\n", pack_name, stickers); } - println!("Total Missing {:#?}", total_missing); + println!("Total Missing {:#?}\n", total_missing); + + println!("Missing From All {:#?}", missing_from_all); }