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

Improve a little code section in registry.rs

This commit is contained in:
Sergio
2024-11-16 12:25:10 +02:00
parent 0c3f293fa8
commit 6b83f51749

View File

@@ -129,9 +129,7 @@ pub async fn get_latest_tag(
let mut next_url = Some(url); let mut next_url = Some(url);
while next_url.is_some() { while next_url.is_some() {
#[allow(unused_assignments)] let (new_tags, next) =
let mut new_tags = Vec::new();
(new_tags, next_url) =
match get_extra_tags(&next_url.unwrap(), headers.clone(), base, client).await { match get_extra_tags(&next_url.unwrap(), headers.clone(), base, client).await {
Ok(t) => t, Ok(t) => t,
Err(message) => { Err(message) => {
@@ -142,7 +140,8 @@ pub async fn get_latest_tag(
} }
} }
}; };
tags.append(&mut new_tags); tags.extend_from_slice(&new_tags);
next_url = next;
} }
let tag = tags.iter().max(); let tag = tags.iter().max();
let current_tag = match &image.version_info { let current_tag = match &image.version_info {