@@ -85,8 +85,14 @@ if len(signature({}).parameters) != {}:
8585"# ,
8686 & payload. python_function_call, num_args
8787 ) ;
88- self . runner ( ) . run ( & py_analyze_sig) . await . unwrap_or_else ( |_| {
89- panic ! ( "Number of args doesn't match signature of {}." , payload. python_function_call)
88+ self . runner ( )
89+ . run ( & py_analyze_sig)
90+ . await
91+ . unwrap_or_else ( |_| {
92+ panic ! (
93+ "Number of args doesn't match signature of {}." ,
94+ payload. python_function_call
95+ )
9096 } ) ;
9197 } ;
9298 Ok ( StringResponse { value : "Ok" . into ( ) } )
@@ -107,10 +113,8 @@ if len(signature({}).parameters) != {}:
107113 let value = match py_res. as_str ( ) {
108114 Some ( s) => s. to_string ( ) ,
109115 None => py_res. to_string ( ) ,
110- } ;
111- Ok ( StringResponse {
112- value,
113- } )
116+ } ;
117+ Ok ( StringResponse { value } )
114118 }
115119
116120 async fn read_variable ( & self , payload : StringRequest ) -> crate :: Result < StringResponse > {
@@ -217,7 +221,8 @@ pub fn init_and_register<R: Runtime>(python_functions: Vec<&'static str>) -> Tau
217221 register_python_functions (
218222 app,
219223 python_functions. iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ,
220- ) . await ;
224+ )
225+ . await ;
221226 let functions = runner
222227 . read_variable ( "_tauri_plugin_functions" )
223228 . await
@@ -232,10 +237,7 @@ pub fn init_and_register<R: Runtime>(python_functions: Vec<&'static str>) -> Tau
232237 . build ( )
233238}
234239
235- async fn register_python_functions < R : Runtime > (
236- app : & AppHandle < R > ,
237- python_functions : Vec < String > ,
238- ) {
240+ async fn register_python_functions < R : Runtime > ( app : & AppHandle < R > , python_functions : Vec < String > ) {
239241 for function_name in python_functions {
240242 app. register_function ( RegisterRequest {
241243 python_function_call : function_name. clone ( ) ,
@@ -247,4 +249,4 @@ async fn register_python_functions<R: Runtime>(
247249}
248250
249251#[ cfg( test) ]
250- mod tests;
252+ mod tests;
0 commit comments