diff --git a/examples/async.rs b/examples/async.rs index 5adf02d..f1a2710 100644 --- a/examples/async.rs +++ b/examples/async.rs @@ -1,13 +1,16 @@ -use pistones::{lang::Response, Client, Error}; +use pistones::{Client, Error}; #[tokio::main] async fn main() -> Result<(), Error> { - let response = compile_code("rust", "fn main() { println!(\"Hola\") }").await?; - println("{response:?}"); - Ok(()) -} - -async fn compile_code(lang: &str, code: &str) -> Result { let client = Client::new().await?.user_agent("@romancitodev")?; - client.run(lang, code).await + + tokio::spawn(async move { + let _ = client + .run("rust", "fn main() { println!(\"Hola\") }") + .await + .unwrap(); + }); + + println!("hello!"); + Ok(()) } diff --git a/examples/refresh_cache.rs b/examples/refresh_cache.rs index 11e2095..11c7ab2 100644 --- a/examples/refresh_cache.rs +++ b/examples/refresh_cache.rs @@ -3,7 +3,7 @@ use pistones::{Client, Error}; #[tokio::main] async fn main() -> Result<(), Error> { // Normal client - let client = Client::new().await?; + let _ = Client::new().await?; // Create client with cache disabled let client = Client::new().await?.disable_cache();