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

Fix std::convert::TryFrom doc #116594

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,11 @@ pub trait TryInto<T>: Sized {
/// For example, there is no way to convert an [`i64`] into an [`i32`]
/// using the [`From`] trait, because an [`i64`] may contain a value
/// that an [`i32`] cannot represent and so the conversion would lose data.
/// This might be handled by truncating the [`i64`] to an [`i32`] (essentially
/// giving the [`i64`]'s value modulo [`i32::MAX`]) or by simply returning
/// [`i32::MAX`], or by some other method. The [`From`] trait is intended
/// for perfect conversions, so the `TryFrom` trait informs the
/// programmer when a type conversion could go bad and lets them
/// decide how to handle it.
/// This might be handled by truncating the [`i64`] to an [`i32`] or by
/// simply returning [`i32::MAX`], or by some other method. The [`From`]
/// trait is intended for perfect conversions, so the `TryFrom` trait
/// informs the programmer when a type conversion could go bad and lets
/// them decide how to handle it.
///
/// # Generic Implementations
///
Expand Down
Loading