async fn map_user_events_to_free_time(events: Vec<EventPointer>) -> Vec<FreeSlot> {
    // this shouldn't really ever happen (because otherwise people are going to start getting
    // scheduled to do things in the middle of the night)
    if events.is_empty() {
        return vec![FreeSlot {
            start: Utc::now(),
            end: Utc::now() + Duration::days(14),
        }];
    }
    let pad_start = Utc::now();
    let mut free_slots = vec![FreeSlot {
        start: pad_start,
        end: events.get(0).unwrap().start_time().await.unwrap(),
    }];
    for (i, event) in events.iter().enumerate() {
        if i == (events.len() - 1) {
            break;
        }
        let start = event.end_time().await.unwrap();
        let end = events.get(i + 1).unwrap().start_time().await.unwrap();
        free_slots.push(FreeSlot { start, end })
    }
    free_slots
}
/// Maps use events to free time.
Maps use events to free time.
Maps use events to free time .
async fn map_user_events_to_free_time(events: Vec<EventPointer>) -> Vec<FreeSlot> {
    // this shouldn't really ever happen (because otherwise people are going to start getting
    // scheduled to do things in the middle of the night)
    if events.is_empty() {
        return vec![FreeSlot {
            start: Utc::now(),
            end: Utc::now() + Duration::days(14),
        }];
    }
    let pad_start = Utc::now();
    let mut free_slots = vec![FreeSlot {
        start: pad_start,
        end: events.get(0).unwrap().start_time().await.unwrap(),
    }];
    for (i, event) in events.iter().enumerate() {
        if i == (events.len() - 1) {
            break;
        }
        let start = event.end_time().await.unwrap();
        let end = events.get(i + 1).unwrap().start_time().await.unwrap();
        free_slots.push(FreeSlot { start, end })
    }
    free_slots
}
async fn map_user_events_to_free_time ( events : Vec < EventPointer > ) -> Vec < FreeSlot > { // this shouldn't really ever happen (because otherwise people are going to start getting // scheduled to do things in the middle of the night) if events . is_empty ( ) { return vec ! [ FreeSlot { start Utc now ( ) end Utc now ( ) Duration days ( 14 ) } ] ; } let pad_start = Utc :: now ( ) ; let mut free_slots = vec ! [ FreeSlot { start pad_start end events get ( 0 ) unwrap ( ) start_time ( ) await unwrap ( ) } ] ; for ( i , event ) in events . iter ( ) . enumerate ( ) { if i == ( events . len ( ) - 1 ) { break ; } let start = event . end_time ( ) . await . unwrap ( ) ; let end = events . get ( i + 1 ) . unwrap ( ) . start_time ( ) . await . unwrap ( ) ; free_slots . push ( FreeSlot { start , end } ) } free_slots }
Maps use events to free time.
Maps use events to free time .
events
Vec<EventPointer>