Method
add
(&mut self, field: &'static str, error: ValidationError)
Source from the content-addressed store, hash-verified
| 164 | } |
| 165 | |
| 166 | pub fn add(&mut self, field: &'static str, error: ValidationError) { |
| 167 | if let ValidationErrorsKind::Field(ref mut vec) = self |
| 168 | .0 |
| 169 | .entry(Cow::Borrowed(field)) |
| 170 | .or_insert_with(|| ValidationErrorsKind::Field(vec![])) |
| 171 | { |
| 172 | vec.push(error); |
| 173 | } else { |
| 174 | panic!("Attempt to add field validation to a non-Field ValidationErrorsKind instance"); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | #[must_use] |
| 179 | pub fn is_empty(&self) -> bool { |