(&self)
| 176 | |
| 177 | impl ModelValidator<UserError> for User { |
| 178 | fn validate(&self) -> ModelValidatorResult<UserError> { |
| 179 | if let UserSubscriptionStatus::Pending(email) = &self.subscription_status { |
| 180 | validate_email(email)?; |
| 181 | } |
| 182 | validate_stations(&self.stations)?; |
| 183 | |
| 184 | Ok(()) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | #[cfg(test)] |