diff options
| author | tae-soo-kim <117524309+tae-soo-kim@users.noreply.github.com> | 2023-10-10 07:05:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-10 07:05:25 +0000 |
| commit | e15e9a673e6770ae35d2d738aaaff304db9e5616 (patch) | |
| tree | f44c2f84133529a357dfbe607c41e42d086e132b /library/core | |
| parent | fa6d1e75125d9c94c21a58c2301492026031fcb8 (diff) | |
| download | rust-e15e9a673e6770ae35d2d738aaaff304db9e5616.tar.gz rust-e15e9a673e6770ae35d2d738aaaff304db9e5616.zip | |
Update mod.rs
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/convert/mod.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index fc8d19d1a58..9407c1609c2 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -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 /// |
