diff --git a/src/cmd_check_missing.rs b/src/cmd_check_missing.rs index 800db03..ce57ffd 100644 --- a/src/cmd_check_missing.rs +++ b/src/cmd_check_missing.rs @@ -34,7 +34,7 @@ pub async fn check_missing(args: CheckMissingArgs) { }) .collect(); - let total_missing: Vec<&String> = HashMap::<&String, bool>::from_iter( + let mut total_missing: Vec<&String> = HashMap::<&String, bool>::from_iter( missing_stickers .iter() .map(|(_pack_name, stickers)| stickers.clone()) @@ -45,19 +45,22 @@ pub async fn check_missing(args: CheckMissingArgs) { ) .into_keys() .collect(); + total_missing.sort(); - let missing_from_all: Vec<&String> = total_missing + let mut missing_from_all: Vec<&String> = total_missing .clone() .into_iter() .filter(|missing_sticker| { - return missing_stickers + return !missing_stickers .iter() .map(|(_pack_name, stickers)| stickers.contains(missing_sticker)) .any(|x| !x); }) .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); }