Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyRustderive macrosSingle-choice MCQ

Which trait must you derive so that `==` works between two values of a struct?

#[derive(/* ? */)] struct Color { r: u8, g: u8, b: u8 } fn main() { let a = Color { r: 1, g: 2, b: 3 }; let b = Color { r: 1, g: 2, b: 3 }; println!("{}", a == b); }