O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

  1. Remove mut from the closure declaration line. Why does that make the compilation fail?
  2. Remove move from the closure declaration line. What's the effect and why?
  3. It looks like we don't need the block starting from line 4 and ending on line 11. Try to remove that and see if that's true.
  4. Remove both the braces mentioned in the third exercise and use move. What's the effect and why?

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required