Beginner Rust
Q37 / 100

What does the move keyword do in a closure?

Correct! Well done.

Incorrect.

The correct answer is B) Forces the closure to take ownership of all captured variables rather than borrowing them

B

Correct Answer

Forces the closure to take ownership of all captured variables rather than borrowing them

Explanation

move || { use_data(data) } moves data into the closure. Required when passing closures to threads where the outer scope may not outlive the thread.

Progress
37/100