1
0
Fork 0
This commit is contained in:
ChaotiCryptidz 2022-08-22 22:23:15 +01:00
parent aca7b630b5
commit 3322e4d0f7
No known key found for this signature in database

View file

@ -34,7 +34,7 @@ pub async fn check_missing(args: CheckMissingArgs) {
}) })
.collect(); .collect();
let total_missing: Vec<&String> = HashMap::<&String, bool>::from_iter( let mut total_missing: Vec<&String> = HashMap::<&String, bool>::from_iter(
missing_stickers missing_stickers
.iter() .iter()
.map(|(_pack_name, stickers)| stickers.clone()) .map(|(_pack_name, stickers)| stickers.clone())
@ -45,19 +45,22 @@ pub async fn check_missing(args: CheckMissingArgs) {
) )
.into_keys() .into_keys()
.collect(); .collect();
total_missing.sort();
let missing_from_all: Vec<&String> = total_missing let mut missing_from_all: Vec<&String> = total_missing
.clone() .clone()
.into_iter() .into_iter()
.filter(|missing_sticker| { .filter(|missing_sticker| {
return missing_stickers return !missing_stickers
.iter() .iter()
.map(|(_pack_name, stickers)| stickers.contains(missing_sticker)) .map(|(_pack_name, stickers)| stickers.contains(missing_sticker))
.any(|x| !x); .any(|x| !x);
}) })
.collect(); .collect();
missing_from_all.sort();
for (pack_name, stickers) in missing_stickers.iter() { for (pack_name, stickers) in missing_stickers.clone().iter_mut() {
stickers.sort();
println!("Pack: {}\nMissing: {:#?}\n", pack_name, stickers); println!("Pack: {}\nMissing: {:#?}\n", pack_name, stickers);
} }