diff --git a/exercises/05_ticket_v2/15_outro/src/status.rs b/exercises/05_ticket_v2/15_outro/src/status.rs index 0611887d29..f4507a43a8 100644 --- a/exercises/05_ticket_v2/15_outro/src/status.rs +++ b/exercises/05_ticket_v2/15_outro/src/status.rs @@ -12,6 +12,14 @@ impl TryFrom for Status { type Error = ParseStatusError; fn try_from(value: String) -> Result { + value.try_into() + } +} + +impl TryFrom<&str> for Status { + type Error = ParseStatusError; + + fn try_from(value: &str) -> Result { let value = value.to_lowercase(); match value.as_str() { "todo" => Ok(Status::ToDo), @@ -24,14 +32,6 @@ impl TryFrom for Status { } } -impl TryFrom<&str> for Status { - type Error = ParseStatusError; - - fn try_from(value: &str) -> Result { - value.to_lowercase().try_into() - } -} - #[derive(Debug, thiserror::Error)] #[error("`{invalid_status}` is not a valid status. Use one of: ToDo, InProgress, Done")] pub struct ParseStatusError {