@@ -25,22 +25,22 @@ pub(crate) async fn python_thread_main(mut receiver: mpsc::Receiver<PyCommand>)
2525            let  result = match  std:: mem:: replace ( & mut  cmd. cmd_type ,  CmdType :: Stop )  { 
2626                CmdType :: RunCode ( code)  => { 
2727                    let  c_code = CString :: new ( code) . expect ( "CString::new failed" ) ; 
28-                     py. run ( & c_code,  Some ( & globals) ,  None ) . map ( |_| Value :: Null ) 
28+                     py. run ( & c_code,  Some ( globals) ,  None ) . map ( |_| Value :: Null ) 
2929                } 
3030                CmdType :: EvalCode ( code)  => { 
3131                    let  c_code = CString :: new ( code) . expect ( "CString::new failed" ) ; 
32-                     py. eval ( & c_code,  Some ( & globals) ,  None ) 
33-                         . and_then ( |obj| py_any_to_json ( py ,   & obj) ) 
32+                     py. eval ( & c_code,  Some ( globals) ,  None ) 
33+                         . and_then ( |obj| py_any_to_json ( & obj) ) 
3434                } 
35-                 CmdType :: RunFile ( file)  => handle_run_file ( py,  & globals,  file) , 
35+                 CmdType :: RunFile ( file)  => handle_run_file ( py,  globals,  file) , 
3636                CmdType :: ReadVariable ( var_name)  => { 
37-                     get_py_object ( & globals,  & var_name) . and_then ( |obj| py_any_to_json ( py ,   & obj) ) 
37+                     get_py_object ( globals,  & var_name) . and_then ( |obj| py_any_to_json ( & obj) ) 
3838                } 
3939                CmdType :: CallFunction  {  name,  args }  => { 
40-                     handle_call_function ( py,  & globals,  name,  args) 
40+                     handle_call_function ( py,  globals,  name,  args) 
4141                } 
4242                CmdType :: CallAsyncFunction  {  name,  args }  => { 
43-                     let  func = get_py_object ( & globals,  & name) . unwrap ( ) ;  // TODO; 
43+                     let  func = get_py_object ( globals,  & name) . unwrap ( ) ;  // TODO; 
4444                    check_func_callable ( & func,  & name) . unwrap ( ) ;  // TODO 
4545                    let  func = func. unbind ( ) ; 
4646
@@ -110,7 +110,7 @@ with open({}, 'r') as f:
110110        print_path_for_python( & file. to_path_buf( ) ) 
111111    ) ; 
112112    let  c_code = CString :: new ( code) . expect ( "CString::new failed" ) ; 
113-     py. run ( & c_code,  Some ( & globals) ,  None ) . map ( |_| Value :: Null ) 
113+     py. run ( & c_code,  Some ( globals) ,  None ) . map ( |_| Value :: Null ) 
114114} 
115115
116116/// Handles the `CallFunction` command. 
@@ -124,7 +124,7 @@ fn handle_call_function(
124124    check_func_callable ( & func,  & name) ?; 
125125    let  t_args = vec_to_py_tuple ( & py,  args) ?; 
126126    let  result = func. call1 ( t_args) ?; 
127-     py_any_to_json ( py ,   & result) 
127+     py_any_to_json ( & result) 
128128} 
129129
130130fn  vec_to_py_tuple < ' py > ( 
@@ -155,13 +155,13 @@ async fn handle_call_async_function(
155155        let  result = loop_obj. call_method1 ( "run_until_complete" ,  ( coroutine, ) ) ?; 
156156        loop_obj. call_method0 ( "close" ) ?; 
157157
158-         py_any_to_json ( py ,   & result) 
158+         py_any_to_json ( & result) 
159159    } ) ; 
160160    let  _ = responder. send ( result. map_err ( |e| e. to_string ( ) ) ) ; 
161161} 
162162
163163/// Recursively converts a Python object to a `serde_json::Value`. 
164- fn  py_any_to_json ( py :   Python ,   obj :  & pyo3:: Bound < ' _ ,  PyAny > )  -> PyResult < Value >  { 
164+ fn  py_any_to_json ( obj :  & pyo3:: Bound < ' _ ,  PyAny > )  -> PyResult < Value >  { 
165165    if  obj. is_none ( )  { 
166166        return  Ok ( Value :: Null ) ; 
167167    } 
@@ -186,13 +186,13 @@ fn py_any_to_json(py: Python, obj: &pyo3::Bound<'_, PyAny>) -> PyResult<Value> {
186186    } 
187187    if  let  Ok ( list)  = obj. cast :: < PyList > ( )  { 
188188        let  items:  PyResult < Vec < Value > >  =
189-             list. iter ( ) . map ( |item| py_any_to_json ( py ,   & item) ) . collect ( ) ; 
189+             list. iter ( ) . map ( |item| py_any_to_json ( & item) ) . collect ( ) ; 
190190        return  Ok ( Value :: Array ( items?) ) ; 
191191    } 
192192    if  let  Ok ( dict)  = obj. cast :: < PyDict > ( )  { 
193193        let  mut  map = serde_json:: Map :: new ( ) ; 
194194        for  ( key,  value)  in  dict. iter ( )  { 
195-             map. insert ( key. to_string ( ) ,  py_any_to_json ( py ,   & value) ?) ; 
195+             map. insert ( key. to_string ( ) ,  py_any_to_json ( & value) ?) ; 
196196        } 
197197        return  Ok ( Value :: Object ( map) ) ; 
198198    } 
0 commit comments