News for hackers. Stuff that matters.
Re:Should Small Rust Structs be Passed by-copy or by-borrow? by touisteur on Sunday January 01, 2023 @08:24PM (#34213128)
Wouldn't any sane fork system capture the value of the loop variable instead of a reference to it? Why would anyone ever want to capture a reference to a loop variable that will be moved under one's feet? I'm sorry I'm struggling to understand what we're doing here and why.
Re:Should Small Rust Structs be Passed by-copy or by-borrow? by throwaway894345 on Sunday January 01, 2023 @11:26PM (#34214353)
No, the capturing is done by the closure and as far as I know capturing by reference is pretty standard for closures across languages. The forking system just runs the closure in a thread, agnostic to any capturing details.