Skip to content

Commit

Permalink
Refactored to remove match from fn withdrawn_date_before_publication_…
Browse files Browse the repository at this point in the history
…date_error
  • Loading branch information
brendan-oconnell committed Apr 25, 2024
1 parent 6d15f3c commit 1aaf824
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions thoth-api/src/model/work/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,12 @@ pub trait WorkProperties {
}

fn withdrawn_date_before_publication_date_error(&self) -> ThothResult<()> {
match (self.withdrawn_date(), self.publication_date()) {
(Some(withdrawn_date), Some(publication_date)) if withdrawn_date < publication_date => {
println!("withdrawn_date: {:?}", self.withdrawn_date());
println!("publication_date: {:?}", self.publication_date());
if let (Some(withdrawn_date), Some(publication_date)) =
(self.withdrawn_date(), self.publication_date())
{
if withdrawn_date < publication_date {
return Err(ThothError::WithdrawnDateBeforePublicationDateError);
}
_ => {}
}
Ok(())
}
Expand Down

0 comments on commit 1aaf824

Please sign in to comment.