From 638dde7704a3ef82c10c6b0d8b3f8408de9df033 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Wed, 21 Dec 2022 16:46:23 -0800 Subject: [PATCH] Clarify from/into I found the phrasing confusing. Mentionning that a class implements From and then using `into()` seems confusing. It looks like that you meant that it implements `Into`. So I believe that a little more details may help show why this exercise is valid. I would have considered clarifying that `into` does not need to specify that we use the implementation for `i16` thanks to type analysis, but I assume this would add too much text, and this can either be ignored by the reader for the time being, or guessed --- src/exercises/day-1/implicit-conversions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/exercises/day-1/implicit-conversions.md b/src/exercises/day-1/implicit-conversions.md index af830e29..adf94cd7 100644 --- a/src/exercises/day-1/implicit-conversions.md +++ b/src/exercises/day-1/implicit-conversions.md @@ -23,8 +23,9 @@ Implementing these traits is how a type expresses that it can be converted into another type. The standard library has an implementation of `From for i16`, which means -that we can convert an `i8` to an `i16` by calling the `into()` method on the -`i8`. +that we can convert a variable `x` of type `i8` to an `i16` by calling +`i16::from(x)`. Or, simpler, with `x.into()`, because `From for i16` +implementation automatically create an implementation of `Into for i8`. 1. Execute the above program and look at the compiler error.