Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From and Into slide should emphasize losslessness and infallibility #2069

Open
fw-immunant opened this issue May 9, 2024 · 0 comments
Open
Assignees

Comments

@fw-immunant
Copy link
Collaborator

The standard library docs mention this:

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.

@fw-immunant fw-immunant self-assigned this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant