@@ -63,21 +63,17 @@ fn get_ordered_dict_type(py: Python<'_>) -> &Bound<'_, PyType> {
63
63
}
64
64
65
65
fn check_if_ordered_dict ( obj : & Bound < ' _ , PyAny > ) -> bool {
66
- println ! ( "check_if_ordered_dict: {:?}" , obj) ;
67
66
if obj. is_exact_instance_of :: < PyDict > ( ) {
68
- println ! ( "is exact dict" ) ;
69
67
return false ;
70
68
}
71
69
72
70
if let Ok ( type_name) = obj. get_type ( ) . name ( ) {
73
- println ! ( "this is the type name: {}" , type_name) ;
74
71
if type_name. to_string ( ) != "OrderedDict" {
75
72
return false ;
76
73
}
77
74
}
78
75
79
76
let ordered_dict_type = get_ordered_dict_type ( obj. py ( ) ) ;
80
- println ! ( "is ordered dict type: {}" , ordered_dict_type) ;
81
77
obj. is_instance ( ordered_dict_type) . unwrap_or ( false )
82
78
}
83
79
@@ -432,14 +428,13 @@ impl<'py> Input<'py> for Bound<'py, PyAny> {
432
428
Ok ( GenericPyMapping :: Dict ( self . downcast :: < PyDict > ( ) ?) )
433
429
} else if check_if_ordered_dict ( self ) {
434
430
Ok ( GenericPyMapping :: Mapping ( self . downcast :: < PyMapping > ( ) ?) )
435
- }
436
- else {
431
+ } else {
437
432
Err ( ValError :: new ( ErrorTypeDefaults :: DictType , self ) )
438
433
}
439
434
}
440
435
441
436
fn lax_dict < ' a > ( & ' a self ) -> ValResult < GenericPyMapping < ' a , ' py > > {
442
- if ( self . is_instance_of :: < PyDict > ( ) || self . is_instance_of :: < PyMapping > ( ) ) {
437
+ if self . is_instance_of :: < PyDict > ( ) || self . is_instance_of :: < PyMapping > ( ) {
443
438
Ok ( GenericPyMapping :: Mapping ( self . downcast :: < PyMapping > ( ) ?) )
444
439
} else {
445
440
Err ( ValError :: new ( ErrorTypeDefaults :: DictType , self ) )
0 commit comments