From 7038eb8c61e0c84ff6600d5a9533521fa92c2bce Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Mon, 9 Aug 2021 03:26:37 +0200 Subject: [PATCH] fix(try_from_into): Hint at `&str` to `Box` conversion. --- exercises/conversions/try_from_into.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/exercises/conversions/try_from_into.rs b/exercises/conversions/try_from_into.rs index c0b5d986..252e0eec 100644 --- a/exercises/conversions/try_from_into.rs +++ b/exercises/conversions/try_from_into.rs @@ -19,9 +19,14 @@ struct Color { // You need to create an implementation for a tuple of three integers, // an array of three integers and a slice of integers. // -// Note that the implementation for tuple and array will be checked at compile time, +// Note that correct RGB color values must be integers in the 0..=255 range. +// +// Also note that the implementation for tuple and array will be checked at compile time, // but the slice implementation needs to check the slice length! -// Also note that correct RGB color values must be integers in the 0..=255 range. +// A little hint: +// `Box` implements the `From` trait over `&str`. +// This means you can call `"...".into()` to convert +// and box your custom error to return as `Result::Err`. // Tuple implementation impl TryFrom<(i16, i16, i16)> for Color {