Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit d4c80c8

Browse files
committed
Clarify conversion guideline
1 parent 09d1b8f commit d4c80c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

features/types/conversions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
### Associate conversions with the most specific type involved. **[FIXME: needs RFC]**
44

5+
When in doubt, prefer `to_`/`as_`/`into_` to `from_`, because they are
6+
more ergonomic to use (and can be chained with other methods).
7+
58
For many conversions between two types, one of the types is clearly more
69
"specific": it provides some additional invariant or interpretation that is not
710
present in the other type. For example, `str` is more specific than `&[u8]`,

0 commit comments

Comments
 (0)