O'Reilly logo
  • Ivan Zderadicka thinks this is interesting:

The thread returns a reference to the same String, so we get it back to the original thread after calling join.

From

Cover of Mastering Rust

Note

This is clearly wrong for above code - outside_string is moved to closure and is not returned back unless we return it explicitly from the closure and then unwrap it from join result