[#13] small changes

master
Jef Roosens 2021-04-08 23:00:54 +02:00
parent e4b8be3ba3
commit edc3605770
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
2 changed files with 2 additions and 3 deletions

View File

@ -45,7 +45,8 @@ pub fn get_pickup_times(
.iter()
.filter(|m| m.contains_key("date") && m.contains_key("label"))
{
// Because we filtered the maps in the loop, we can safely us unwrap here
// Because we filtered the maps in the loop, we can safely use unwrap
// here
if let Ok(date) = BasicDate::try_from(map.get("date").unwrap().as_str()) {
output.push(PickupTime::new(date, map.get("label").unwrap().to_string()))
}

View File

@ -13,7 +13,6 @@ use std::convert::TryFrom;
#[derive(Debug, PartialEq)]
pub struct BasicDate(pub DateTime<Tz>);
/// This allows us to use BasicDate as a query parameter in our routes.
impl<'v> FromFormValue<'v> for BasicDate {
type Error = &'v RawStr;
@ -25,7 +24,6 @@ impl<'v> FromFormValue<'v> for BasicDate {
}
}
/// This is used to serialize BasicDate.
impl TryFrom<&str> for BasicDate {
type Error = FejError;