Answers for "rust•armanazi•error•error[E0382]: borrow of moved value: `val` ... thread"

0

rust•armanazi•error•error[E0382]: borrow of moved value: `val` ... thread

//resolved by commenting println line
    thread::spawn(move || {
        let val = String::from("hi");
        tx.send(val).unwrap();
       // println!("val is {}", val);
    });
Posted by: Guest on March-21-2022

Code answers related to "rust•armanazi•error•error[E0382]: borrow of moved value: `val` ... thread"

Browse Popular Code Answers by Language