diff --git a/book/src/04_traits/08_from.md b/book/src/04_traits/08_from.md index 030e27f..7fef761 100644 --- a/book/src/04_traits/08_from.md +++ b/book/src/04_traits/08_from.md @@ -105,7 +105,7 @@ though the former bound is implicit. In [`std`'s documentation](https://doc.rust-lang.org/std/convert/trait.From.html#implementors) you can see which `std` types implement the `From` trait. -You'll find that `&str` implements `From<&str> for String`. Thus, we can write: +You'll find that `String` implements `From<&str> for String`. Thus, we can write: ```rust let title = String::from("A title"); @@ -129,7 +129,7 @@ where } ``` -If a type `T` implements `From`, then `Into for T` is automatically implemented. That's why +If a type `U` implements `From`, then `Into for T` is automatically implemented. That's why we can write `let title = "A title".into();`. ## `.into()` diff --git a/exercises/04_traits/08_from/src/lib.rs b/exercises/04_traits/08_from/src/lib.rs index 7f082ab..cc6f5b1 100644 --- a/exercises/04_traits/08_from/src/lib.rs +++ b/exercises/04_traits/08_from/src/lib.rs @@ -1,4 +1,4 @@ -// TODO: Implement the `From` trait for the `u32` type to make `example` compile. +// TODO: Implement the `From` trait for the `WrappingU32` type to make `example` compile. pub struct WrappingU32 { value: u32,