Skip to content

Commit fe5aa22

Browse files
authored
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`.
1 parent 2048289 commit fe5aa22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/conversion/from_into.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn main() {
7474
`From` and `Into` are designed to be complementary.
7575
We do not need to provide an implementation for both traits.
7676
If you have implemented the `From` trait for your type, `Into` will call it
77-
when necessary.
77+
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`.
7878

7979
```rust,editable
8080
use std::convert::From;

0 commit comments

Comments
 (0)