mirror of
https://github.com/mainmatter/100-exercises-to-learn-rust
synced 2025-01-14 08:01:53 +01:00
16 lines
460 B
Rust
16 lines
460 B
Rust
//! TODO: get the code to compile by **re-ordering** the statements
|
|
//! in the `example` function. You're not allowed to change the
|
|
//! `spawner` function nor what each line does in `example`.
|
|
//! You can wrap existing statements in blocks `{}` if needed.
|
|
use std::rc::Rc;
|
|
use tokio::task::yield_now;
|
|
|
|
fn spawner() {
|
|
tokio::spawn(example());
|
|
}
|
|
|
|
async fn example() {
|
|
let non_send = Rc::new(1);
|
|
yield_now().await;
|
|
println!("{}", non_send);
|
|
}
|