Skip to content

Commit

Permalink
Fix panic when same image is tagged multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
frankwiles committed May 27, 2021
1 parent f439bf5 commit 73f7ed3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ async fn get_images(query: &str) -> Vec<ImageSummary> {
}
}

// Sort and deduplicate
matching_images.sort_by(|a, b| b.id.cmp(&a.id));
matching_images.dedup();

return matching_images;
}

Expand Down

0 comments on commit 73f7ed3

Please sign in to comment.