Module A2 - Ownership & references

Slides

A2.1 Move semantics

This exercise is adapted from the move semantics exercise from Rustlings

This exercise enables you to practise with move semantics. It works similarly to exercise A1.1. To get started, exercises/A2/1-move-semantics in your editor and run

cargo run --bin 01

Make all exercises compile. For some of them, extra instructions are included as doc comments at the top of the file. Make sure to adhere to them.

A2.2 Borrowing

Fix the two examples in the exercises/A2/2-borrowing crate! Don't forget you can run individual binaries by using cargo run --bin 01 in that directory! Make sure to follow the instructions that are in the comments!