@@ -10,7 +10,7 @@ pub fn call_function(func: PyObject, args: &[PyObject], arena: &mut PyArena) ->
1010 match func {
1111 PyObject :: Internal ( inner) => {
1212 match inner {
13- PyInternalObject :: InternalFunction ( func) => eval_internal_func ( func, args, arena) ,
13+ PyInternalObject :: InternalFunction ( func) => eval_internal_func ( & func, args, arena) ,
1414 PyInternalObject :: InternalClass ( pyclass) => eval_obj_init ( pyclass, args, arena)
1515 }
1616 }
@@ -24,7 +24,7 @@ pub fn call_function(func: PyObject, args: &[PyObject], arena: &mut PyArena) ->
2424 }
2525}
2626
27- pub fn call_function_1_arg_min ( func : PyObject , first_arg : & PyObject , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
27+ pub fn call_function_1_arg_min ( func : & PyObject , first_arg : & PyObject , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
2828 match func {
2929 PyObject :: Internal ( inner) => {
3030 match inner {
@@ -42,7 +42,7 @@ pub fn call_function_1_arg_min(func: PyObject, first_arg: &PyObject, args: &[PyO
4242 }
4343}
4444
45- pub ( crate ) fn eval_internal_func ( func : Rc < PyInternalFunction > , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
45+ pub ( crate ) fn eval_internal_func ( func : & Rc < PyInternalFunction > , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
4646 match ( func. deref ( ) , args. len ( ) ) {
4747 ( PyInternalFunction :: NewFunc ( func) , n) => {
4848 func ( arena, expect_class ( & args[ 0 ] ) , & args[ 1 ..n] ) // TODO find a way to not clone the class
@@ -66,7 +66,7 @@ pub(crate) fn eval_internal_func(func: Rc<PyInternalFunction>, args: &[PyObject]
6666 }
6767}
6868
69- pub ( crate ) fn eval_internal_func_1_arg_min ( func : Rc < PyInternalFunction > , first_arg : & PyObject , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
69+ pub ( crate ) fn eval_internal_func_1_arg_min ( func : & Rc < PyInternalFunction > , first_arg : & PyObject , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
7070 match ( func. deref ( ) , args. len ( ) ) {
7171 ( PyInternalFunction :: NewFunc ( func) , _n) => {
7272 func ( arena, expect_class ( first_arg) , args)
@@ -101,8 +101,8 @@ pub(crate) fn eval_obj_init(pyclass: Rc<PyClass>, args: &[PyObject], arena: &mut
101101 panic ! ( "{:?} has no __init__ method" , pyclass)
102102 }
103103
104- let new_func = new_func. unwrap ( ) ;
105- let init_func = init_func. unwrap ( ) ;
104+ let ref new_func = new_func. unwrap ( ) ;
105+ let ref init_func = init_func. unwrap ( ) ;
106106
107107 let new_object = call_function_1_arg_min ( new_func, & PyObject :: new_internal_class ( pyclass) , & args, arena) ?;
108108
@@ -112,8 +112,8 @@ pub(crate) fn eval_obj_init(pyclass: Rc<PyClass>, args: &[PyObject], arena: &mut
112112}
113113
114114pub ( crate ) fn init_internal_class ( pyclass : Rc < PyClass > , args : & [ PyObject ] , arena : & mut PyArena ) -> FuncReturnType {
115- let new_func = pyclass. get_magic_method_internal ( & PyMagicMethod :: New ) . unwrap ( ) ;
116- let init_func = pyclass. get_magic_method_internal ( & PyMagicMethod :: Init ) . unwrap ( ) ;
115+ let ref new_func = pyclass. get_magic_method_internal ( & PyMagicMethod :: New ) . unwrap ( ) ;
116+ let ref init_func = pyclass. get_magic_method_internal ( & PyMagicMethod :: Init ) . unwrap ( ) ;
117117
118118 let new_object = eval_internal_func_1_arg_min ( new_func, & PyObject :: new_internal_class ( pyclass) , & args, arena) ?;
119119
0 commit comments