File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -521,35 +521,33 @@ impl Config {
521
521
fn check_bounds ( start : & Option < Bound > , end : & Option < Bound > ) -> Result < ( ) , Error > {
522
522
// current UTC date
523
523
let current = Utc :: now ( ) . date ( ) ;
524
- match ( & start, & end) {
524
+ match start. as_ref ( ) . zip ( end. as_ref ( ) ) {
525
525
// start date is after end date
526
- ( Some ( Bound :: Date ( start) ) , Some ( Bound :: Date ( end) ) ) if end < start => {
526
+ Some ( ( Bound :: Date ( start) , Bound :: Date ( end) ) ) if end < & start => {
527
527
bail ! (
528
528
"end should be after start, got start: {} and end {}" ,
529
529
start,
530
530
end
531
531
) ;
532
532
}
533
533
// start date is after current date
534
- ( Some ( Bound :: Date ( start) ) , Some ( Bound :: Date ( _end ) ) ) if start > & current => {
534
+ Some ( ( Bound :: Date ( start) , _ ) ) if start > & current => {
535
535
bail ! (
536
536
"start date should be on or before current date, got start date request: {} and current date is {}" ,
537
537
start,
538
538
current
539
539
) ;
540
540
}
541
541
// end date is after current date
542
- ( Some ( Bound :: Date ( _start ) ) , Some ( Bound :: Date ( end) ) ) if end > & current => {
542
+ Some ( ( _ , Bound :: Date ( end) ) ) if end > & current => {
543
543
bail ! (
544
544
"end date should be on or before current date, got start date request: {} and current date is {}" ,
545
545
end,
546
546
current
547
547
) ;
548
548
}
549
- _ => { }
549
+ _ => Ok ( ( ) )
550
550
}
551
-
552
- Ok ( ( ) )
553
551
}
554
552
555
553
// Application entry point
You can’t perform that action at this time.
0 commit comments