From 73f7ed358dc25ede68f194abe47400e8325f6a04 Mon Sep 17 00:00:00 2001 From: Frank Wiles Date: Thu, 27 May 2021 07:04:37 -0500 Subject: [PATCH] Fix panic when same image is tagged multiple times --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3e3787e..83942bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,6 +45,10 @@ async fn get_images(query: &str) -> Vec { } } + // Sort and deduplicate + matching_images.sort_by(|a, b| b.id.cmp(&a.id)); + matching_images.dedup(); + return matching_images; }