Skip to content

Commit

Permalink
add back else case
Browse files Browse the repository at this point in the history
  • Loading branch information
pvichivanives committed Dec 19, 2024
1 parent 2799c01 commit ee1c5aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions validator/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ impl ValidationErrors {
fn add_nested(&mut self, field: &'static str, errors: ValidationErrorsKind) {
if let Vacant(entry) = self.0.entry(field) {
entry.insert(errors);
} else {
panic!("Attempt to replace non-empty ValidationErrors entry");
}
// Else case here is simply do nothing. Pretty sure this is caught earlier to not run but since
// If we get here, just not adding it does the same thing (although waste extra compute)
// probably better to just ignore here.
}

#[must_use]
Expand Down

0 comments on commit ee1c5aa

Please sign in to comment.