Fix dates (hopefully)
This commit is contained in:
parent
ae1f1edd76
commit
196458be0e
1 changed files with 6 additions and 6 deletions
|
@ -57,13 +57,13 @@ pub struct Image {
|
||||||
impl FromStr for Image {
|
impl FromStr for Image {
|
||||||
type Err = String;
|
type Err = String;
|
||||||
fn from_str(value: &str) -> Result<Self, String> {
|
fn from_str(value: &str) -> Result<Self, String> {
|
||||||
let mut parts = value.split_whitespace().map(|x| x.to_owned());
|
let parts: Vec<String> = value.split_whitespace().map(|x| x.to_owned()).collect();
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
repository: parts.next().expect("Failed to get repository."),
|
repository: parts[0].clone(),
|
||||||
tag: parts.next().expect("Failed to get tag."),
|
tag: parts[1].clone(),
|
||||||
id: parts.next().expect("Failed to get ID."),
|
id: parts[2].clone(),
|
||||||
created: parts.next().expect("Failed to get created time."),
|
created: parts[3..(parts.len() - 1)].join(" "),
|
||||||
size: parts.next().expect("Failed to get size."),
|
size: parts.last().expect("Failed to get last item!").clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue