File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,7 @@ struct SingleDispatchState {
75
75
impl SingleDispatchState {
76
76
fn find_impl ( & mut self , py : Python , cls : Bound < ' _ , PyAny > ) -> PyResult < PyObject > {
77
77
let cls_mro = get_obj_mro ( & cls. clone ( ) ) ?;
78
- let mro = match compose_mro ( py, cls. clone ( ) , self . registry . keys ( ) ) {
79
- Ok ( mro) => mro,
80
- Err ( e) => return Err ( e) ,
81
- } ;
78
+ let mro = compose_mro ( py, cls. clone ( ) , self . registry . keys ( ) ) ?;
82
79
let mut mro_match: Option < PyTypeReference > = None ;
83
80
eprintln ! ( "Finding impl for {cls}" ) ;
84
81
for typ in mro. iter ( ) {
@@ -136,10 +133,7 @@ impl SingleDispatchState {
136
133
None => {
137
134
let handler_for_cls = match self . registry . get ( & type_reference) {
138
135
Some ( handler) => handler. clone_ref ( py) ,
139
- None => match self . find_impl ( py, free_cls. bind ( py) . clone ( ) ) {
140
- Ok ( handler) => handler,
141
- Err ( e) => return Err ( e) ,
142
- } ,
136
+ None => self . find_impl ( py, free_cls. bind ( py) . clone ( ) ) ?,
143
137
} ;
144
138
self . cache
145
139
. insert ( type_reference, handler_for_cls. clone_ref ( py) ) ;
You can’t perform that action at this time.
0 commit comments