/// Check that the event information is valid. Returns an empty list if it is, or a list of
/// problems if not.
Check that the event information is valid. Returns an empty list if it is, or a list of
problems if not.
Check that the event information is valid . Returns an empty list if it is or a list of problems if not .
pub fn validate(&self) -> Vec<&'static str> {
        let mut problems = vec![];
        if !self.workshop && !self.social {
            problems.push("Must have at least a workshop or a social.")
        }
        match self.time {
            EventTime::DateOnly {
                start_date,
                end_date,
            } => {
                if start_date > end_date {
                    problems.push("Start date must be before or equal to end date.");
                }
            }
            EventTime::DateTime { start, end } => {
                if start > end {
                    problems.push("Start must be before or equal to end.");
                }
            }
        }
        if self.styles.is_empty() {
            problems.push("Must include at least one style of dance.")
        }
        problems
    }
pub fn validate ( & self ) -> Vec < & ' static str > { let mut problems = vec ! [ ] ; if ! self . workshop && ! self . social { problems . push ( " " ) } match self . time { EventTime :: DateOnly { start_date , end_date , } => { if start_date > end_date { problems . push ( " " ) ; } } EventTime :: DateTime { start , end } => { if start > end { problems . push ( " " ) ; } } } if self . styles . is_empty ( ) { problems . push ( " " ) } problems }
Check that the event information is valid.
Check that the event information is valid .
&self