Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/concept/resistor-color/.meta/exemplar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pub enum ResistorColor {
}

pub fn color_to_value(color: ResistorColor) -> usize {
color.int_value()
color.into()
}

pub fn value_to_color_string(value: usize) -> String {
ResistorColor::from_int(value)
ResistorColor::try_from(value)
.map(|color| format!("{color:?}"))
.unwrap_or_else(|_| "value out of range".into())
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/resistor-color/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2024"
# The full list of available libraries is here:
# https://github.com/exercism/rust-test-runner/blob/main/local-registry/Cargo.toml
[dependencies]
int-enum = "0.5.0"
enum-iterator = "1.2.0"
enum-iterator = "2.0"
int-enum = "1.0"