Skip to content

Commit f244156

Browse files
Simplify line errors section of match
Co-authored-by: David Hewitt <[email protected]>
1 parent 8954a0a commit f244156

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/validators/dataclass.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,11 @@ impl Validator for DataclassArgsValidator {
186186
},
187187
Ok(None) => continue,
188188
Err(ValError::Omit) => continue,
189-
Err(ValError::LineErrors(line_errors)) => {
190-
for err in line_errors {
191-
// Note: this will always use the field name even if there is an alias
192-
// However, we don't mind so much because this error can only happen if the
193-
// default value fails validation, which is arguably a developer error.
194-
// We could try to "fix" this in the future if desired.
195-
errors.push(err);
196-
}
197-
}
189+
// Note: this will always use the field name even if there is an alias
190+
// However, we don't mind so much because this error can only happen if the
191+
// default value fails validation, which is arguably a developer error.
192+
// We could try to "fix" this in the future if desired.
193+
Err(ValError::LineErrors(line_errors)) => errors.extend(line_errors),
198194
Err(err) => return Err(err),
199195
};
200196
continue;

0 commit comments

Comments
 (0)