Clone and Compare
Create a Score struct with a value: i32 field. Derive Debug, Clone, and PartialEq. Clone a score, modify the clone, then compare them.
Expected output:
text
Original: Score { value: 100 }
Modified: Score { value: 200 }
Equal: falseHints:
- Use
#[derive(Debug, Clone, PartialEq)] - Clone with
let mut copy = original.clone(); - Modify with
copy.value = 200;
rust
fn main() {
}