Skip to content

Commit 71dbad0

Browse files
committed
fix tuple error
1 parent 3fbc45c commit 71dbad0

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/input/generic_iterable.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use crate::errors::ValError;
2+
13
use super::parse_json::{JsonInput, JsonObject};
24
use pyo3::{
35
exceptions::PyTypeError,

src/validators/tuple.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,7 @@ where
275275
output.push(v);
276276
checks.check_output_length(output.len(), input)?;
277277
}
278-
None => {
279-
return Err(ValError::new(
280-
ErrorType::TooShort {
281-
field_type: "Tuple".to_string(),
282-
min_length: items_validators.len(),
283-
actual_length: output.len(),
284-
},
285-
input,
286-
))
287-
}
278+
None => return Err(ValError::new_with_loc(ErrorType::Missing, input, output.len())),
288279
}
289280
}
290281
}

0 commit comments

Comments
 (0)