Skip to content

Commit cad59ca

Browse files
committed
fixing test
1 parent d023d05 commit cad59ca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/validators/enum_.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ impl EnumValidateValue for PlainEnumValidator {
169169
lookup: &LiteralLookup<PyObject>,
170170
strict: bool,
171171
) -> ValResult<Option<PyObject>> {
172-
match Ok(lookup.validate(py, input)?.map(|(_, v)| v.clone_ref(py))) {
173-
Ok(Some(validation_match)) => Ok(Some(validation_match)),
174-
Ok(None) => {
172+
match lookup.validate(py, input)? {
173+
Some((_, v)) => Ok(Some(v.clone_ref(py))),
174+
None => {
175175
if !strict {
176176
if let Some(py_input) = input.as_python() {
177177
// necessary for compatibility with 2.6, where str and int subclasses are allowed
@@ -187,7 +187,6 @@ impl EnumValidateValue for PlainEnumValidator {
187187
}
188188
Ok(None)
189189
}
190-
Err(val_err) => Err(val_err),
191190
}
192191
}
193192
}

0 commit comments

Comments
 (0)