From 196458be0e3b91fda46cec9220a41c762e7abf7f Mon Sep 17 00:00:00 2001 From: Hellx2 Date: Sun, 18 Aug 2024 20:21:09 +1000 Subject: [PATCH] Fix dates (hopefully) --- src/containers/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/containers/mod.rs b/src/containers/mod.rs index da9d9b5..e8128e1 100644 --- a/src/containers/mod.rs +++ b/src/containers/mod.rs @@ -57,13 +57,13 @@ pub struct Image { impl FromStr for Image { type Err = String; fn from_str(value: &str) -> Result { - let mut parts = value.split_whitespace().map(|x| x.to_owned()); + let parts: Vec = value.split_whitespace().map(|x| x.to_owned()).collect(); Ok(Self { - repository: parts.next().expect("Failed to get repository."), - tag: parts.next().expect("Failed to get tag."), - id: parts.next().expect("Failed to get ID."), - created: parts.next().expect("Failed to get created time."), - size: parts.next().expect("Failed to get size."), + repository: parts[0].clone(), + tag: parts[1].clone(), + id: parts[2].clone(), + created: parts[3..(parts.len() - 1)].join(" "), + size: parts.last().expect("Failed to get last item!").clone(), }) } }