Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvankhademi committed Apr 11, 2024
1 parent 33521d9 commit b4ecb3f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/agent/market_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ fn time_range_parser<'s>(input: &mut &'s str) -> PResult<ScheduleDayKind> {
let (start_str, end_str) = separated_pair(take(4usize), "-", take(4usize)).parse_next(input)?;

let start_time = NaiveTime::parse_from_str(start_str, "%H%M")
.map_err(|e| ErrMode::from_error_kind(input, ErrorKind::Verify))?;
.map_err(|_| ErrMode::from_error_kind(input, ErrorKind::Verify))?;
let end_time = NaiveTime::parse_from_str(end_str, "%H%M")
.map_err(|e| ErrMode::from_error_kind(input, ErrorKind::Verify))?;
.map_err(|_| ErrMode::from_error_kind(input, ErrorKind::Verify))?;

Ok(ScheduleDayKind::TimeRange(start_time, end_time))
}
Expand Down Expand Up @@ -348,7 +348,6 @@ mod tests {
// Date match after range
assert!(!market_schedule
.can_publish_at(&NaiveDateTime::parse_from_str("2023-04-22 17:01", format)?.and_utc()));

Ok(())
}
}

0 comments on commit b4ecb3f

Please sign in to comment.