File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1- use pistones:: { lang :: Response , Client , Error } ;
1+ use pistones:: { Client , Error } ;
22
33#[ tokio:: main]
44async fn main ( ) -> Result < ( ) , Error > {
5- let response = compile_code ( "rust" , "fn main() { println!(\" Hola\" ) }" ) . await ?;
6- println ( "{response:?}" ) ;
7- Ok ( ( ) )
8- }
9-
10- async fn compile_code ( lang : & str , code : & str ) -> Result < Response , Error > {
115 let client = Client :: new ( ) . await ?. user_agent ( "@romancitodev" ) ?;
12- client. run ( lang, code) . await
6+
7+ tokio:: spawn ( async move {
8+ let _ = client
9+ . run ( "rust" , "fn main() { println!(\" Hola\" ) }" )
10+ . await
11+ . unwrap ( ) ;
12+ } ) ;
13+
14+ println ! ( "hello!" ) ;
15+ Ok ( ( ) )
1316}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use pistones::{Client, Error};
33#[ tokio:: main]
44async fn main ( ) -> Result < ( ) , Error > {
55 // Normal client
6- let client = Client :: new ( ) . await ?;
6+ let _ = Client :: new ( ) . await ?;
77 // Create client with cache disabled
88 let client = Client :: new ( ) . await ?. disable_cache ( ) ;
99
You can’t perform that action at this time.
0 commit comments