You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The From trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom.
But it's easy to miss one line in the docs; I think we should emphasize this in the speaker notes. It also isn't necessarily obvious what "perfect" means, so I think "lossless" is a better way to describe the contract of these traits. This is worth underlining because the commonsense notion of being able to convert between types may also apply to things like C-style casts that truncate and are not appropriate for these traits.
The text was updated successfully, but these errors were encountered:
The standard library docs mention this:
But it's easy to miss one line in the docs; I think we should emphasize this in the speaker notes. It also isn't necessarily obvious what "perfect" means, so I think "lossless" is a better way to describe the contract of these traits. This is worth underlining because the commonsense notion of being able to convert between types may also apply to things like C-style casts that truncate and are not appropriate for these traits.
The text was updated successfully, but these errors were encountered: