Exercise 5 · Chapter: Ownership & BorrowingRequired+50 XP
Copy Types
Numbers are Copy types in Rust — they don't move! Create a variable score set to 100, assign it to backup, then print both to prove they're both valid.
Expected output:
Score: 100 Backup: 100
Hints:
- Just use
let backup = score;— no need for.clone()! - Numbers are automatically copied
rust
fn main() {
}
Output
Run your code to see the output here.