File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
exercises/concept/resistor-color Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ pub enum ResistorColor {
1717}
1818
1919pub fn color_to_value ( color : ResistorColor ) -> usize {
20- color. int_value ( )
20+ color. into ( )
2121}
2222
2323pub fn value_to_color_string ( value : usize ) -> String {
24- ResistorColor :: from_int ( value)
24+ ResistorColor :: try_from ( value)
2525 . map ( |color| format ! ( "{color:?}" ) )
2626 . unwrap_or_else ( |_| "value out of range" . into ( ) )
2727}
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ edition = "2024"
77# The full list of available libraries is here:
88# https://github.com/exercism/rust-test-runner/blob/main/local-registry/Cargo.toml
99[dependencies ]
10- int- enum = " 0.5 .0"
11- enum-iterator = " 1.2 .0"
10+ enum-iterator = " 2 .0"
11+ int-enum = " 1.0"
You can’t perform that action at this time.
0 commit comments