m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-17 09:33:38 -05:00

OMG WE CAN DO SEMVER FOR THE CLI AND THE RESULTS LOOK CORRECT

This commit is contained in:
Sergio
2024-11-01 21:39:15 +02:00
parent 022dc0b2cb
commit c11b5e6432
5 changed files with 278 additions and 64 deletions

View File

@@ -8,8 +8,6 @@ use crate::{
utils::new_reqwest_client,
};
use crate::registry::get_latest_digest;
/// Trait for a type that implements a function `unique` that removes any duplicates.
/// In this case, it will be used for a Vec.
pub trait Unique<T> {
@@ -77,7 +75,7 @@ pub async fn get_updates(images: &[Image], config: &Config) -> Vec<Image> {
// Loop through images and get the latest digest for each
for image in images {
let token = tokens.get(&image.registry.as_ref().unwrap()).unwrap();
let future = get_latest_digest(image, token.as_ref(), config, &client);
let future = image.check(token.as_ref(), config, &client);
handles.push(future);
}
// Await all the futures