File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -346,18 +346,8 @@ impl TypedDictValidator {
346
346
where
347
347
' data : ' s ,
348
348
{
349
- let extra = Extra {
350
- field_name : Some ( field) ,
351
- assignee_field : None ,
352
- ..* extra
353
- } ;
354
- // TODO probably we should set location on errors here
355
- let data = match extra. data {
356
- Some ( data) => data,
357
- None => unreachable ! ( ) ,
358
- } ;
359
-
360
349
let prepare_tuple = |output : PyObject | {
350
+ let data = extra. data . unwrap ( ) ;
361
351
data. set_item ( field, output) ?;
362
352
if self . return_fields_set {
363
353
let fields_set = PySet :: new ( py, & [ field] ) ?;
@@ -379,6 +369,12 @@ impl TypedDictValidator {
379
369
Err ( err) => Err ( err) ,
380
370
} ;
381
371
372
+ let extra = Extra {
373
+ field_name : Some ( field) ,
374
+ assignee_field : None ,
375
+ ..* extra
376
+ } ;
377
+
382
378
if let Some ( field) = self . fields . iter ( ) . find ( |f| f. name == field) {
383
379
if field. frozen {
384
380
Err ( ValError :: new_with_loc ( ErrorType :: Frozen , input, field. name . to_string ( ) ) )
You can’t perform that action at this time.
0 commit comments