Fix ownership of async tasks
This commit is contained in:
parent
82780c0009
commit
510ecfec6d
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ fn main() {
|
||||||
trpl::run(async {
|
trpl::run(async {
|
||||||
let (tx, mut rx) = trpl::channel();
|
let (tx, mut rx) = trpl::channel();
|
||||||
|
|
||||||
let tx_fut = async {
|
let tx_fut = async move {
|
||||||
let vals = vec![
|
let vals = vec![
|
||||||
String::from("hi"),
|
String::from("hi"),
|
||||||
String::from("from"),
|
String::from("from"),
|
||||||
|
@ -20,7 +20,7 @@ fn main() {
|
||||||
|
|
||||||
let rx_fut = async {
|
let rx_fut = async {
|
||||||
while let Some(value) = rx.recv().await {
|
while let Some(value) = rx.recv().await {
|
||||||
println!("received '{value}'");
|
eprintln!("received '{value}'");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue