From fe5aa225cb070baf4c5f5c2cd9ba3032af25cefa Mon Sep 17 00:00:00 2001 From: mckzm <134839822+mckzm@users.noreply.github.com> Date: Sun, 26 May 2024 20:14:37 +0900 Subject: [PATCH] Add precision on From/Into asymmetry to from_into.md Adding a note to the effect that whilst implementing `From` for a type will provide it w/ `Into`, it doesn't work the other way around: implementing `Into` will not give you `From`. --- src/conversion/from_into.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conversion/from_into.md b/src/conversion/from_into.md index 83beb5d27a..22c75dd5b7 100644 --- a/src/conversion/from_into.md +++ b/src/conversion/from_into.md @@ -74,7 +74,7 @@ fn main() { `From` and `Into` are designed to be complementary. We do not need to provide an implementation for both traits. If you have implemented the `From` trait for your type, `Into` will call it -when necessary. +when necessary. Note, however, that the converse is not true: implementing `Into` for your type will not automatically provide it with an implementation of `From`. ```rust,editable use std::convert::From;