Skip to content

Commit fdf0882

Browse files
committed
resistor-color: Use color in unimplemented! message
ResistorColor implements Debug and has to since it's used in an `assert_eq`, so we are adding no additional restrictions and improving clarity by incorporating it into the unimplemented! message.
1 parent 440a6bb commit fdf0882

File tree

1 file changed

+2
-2
lines changed
  • exercises/concept/resistor-color/src

1 file changed

+2
-2
lines changed

exercises/concept/resistor-color/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub enum ResistorColor {
1212
Yellow,
1313
}
1414

15-
pub fn color_to_value(_color: ResistorColor) -> u32 {
16-
unimplemented!("convert a color into a numerical representation")
15+
pub fn color_to_value(color: ResistorColor) -> u32 {
16+
unimplemented!("convert color {color:?} into a numerical representation")
1717
}
1818

1919
pub fn value_to_color_string(value: u32) -> String {

0 commit comments

Comments
 (0)