diff options
Diffstat (limited to 'yt/src/cli.rs')
-rw-r--r-- | yt/src/cli.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/yt/src/cli.rs b/yt/src/cli.rs index fe85a89..d7e084a 100644 --- a/yt/src/cli.rs +++ b/yt/src/cli.rs @@ -230,11 +230,13 @@ pub struct OptionalNaiveDate { } impl FromStr for OptionalNaiveDate { type Err = anyhow::Error; - fn from_str(v: &str) -> Result<Self,Self::Err> { + fn from_str(v: &str) -> Result<Self, Self::Err> { if v == "[No release date]" { - Ok(Self {date: None}) + Ok(Self { date: None }) } else { - Ok(Self {date: Some(NaiveDate::from_str(v)?)}) + Ok(Self { + date: Some(NaiveDate::from_str(v)?), + }) } } } @@ -244,11 +246,13 @@ pub struct OptionalPublisher { } impl FromStr for OptionalPublisher { type Err = anyhow::Error; - fn from_str(v: &str) -> Result<Self,Self::Err> { + fn from_str(v: &str) -> Result<Self, Self::Err> { if v == "[No author]" { - Ok(Self {publisher: None}) + Ok(Self { publisher: None }) } else { - Ok(Self {publisher: Some(v.to_owned())}) + Ok(Self { + publisher: Some(v.to_owned()), + }) } } } |