Fix ownership of async tasks

This commit is contained in:
Manuel Thalmann 2025-04-06 21:40:00 +02:00
parent 82780c0009
commit 510ecfec6d
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -4,7 +4,7 @@ fn main() {
trpl::run(async {
let (tx, mut rx) = trpl::channel();
let tx_fut = async {
let tx_fut = async move {
let vals = vec![
String::from("hi"),
String::from("from"),
@ -20,7 +20,7 @@ fn main() {
let rx_fut = async {
while let Some(value) = rx.recv().await {
println!("received '{value}'");
eprintln!("received '{value}'");
}
};