@@ -366,9 +366,9 @@ pub trait From<T>: Sized {
366366/// provides an equivalent `TryInto` implementation for free, thanks to a
367367/// blanket implementation in the standard library. For more information on this,
368368/// see the documentation for [`Into`].
369- ///
369+ ///
370370/// # Implementing `TryInto`
371- ///
371+ ///
372372/// This suffers the same restrictions and reasoning as implementing
373373/// [`Into`], see there for details.
374374///
@@ -387,25 +387,25 @@ pub trait TryInto<T>: Sized {
387387
388388/// Simple and safe type conversions that may fail in a controlled
389389/// way under some circumstances. It is the reciprocal of [`TryInto`].
390- ///
391- /// This is useful when you are doing a type conversion that may
390+ ///
391+ /// This is useful when you are doing a type conversion that may
392392/// trivially succeed but may also need special handling.
393393/// For example, there is no way to convert an `i64` into an `i32`
394394/// using the [`From`] trait, because an `i64` may contain a value
395395/// that an `i32` cannot represent and so the conversion would lose data.
396396/// This might be handled by truncating the `i64` to an `i32` (essentially
397- /// giving the `i64`'s value modulo `i32::MAX`) or by simply returning
398- /// `i32::MAX`, or by some other method. The `From` trait is intended
399- /// for lossless conversions, so the `TryFrom` trait informs the
397+ /// giving the `i64`'s value modulo `i32::MAX`) or by simply returning
398+ /// `i32::MAX`, or by some other method. The `From` trait is intended
399+ /// for lossless conversions, so the `TryFrom` trait informs the
400400/// programmer when a type conversion could go bad and lets them
401401/// decide how to handle it.
402- ///
402+ ///
403403/// # Generic Implementations
404404///
405405/// - `TryFrom<T> for U` implies [`TryInto<U>`]` for T`
406- /// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
406+ /// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
407407/// is implemented
408- ///
408+ ///
409409/// # Examples
410410///
411411/// As described, [`i32`] implements `TryFrom<i64>`:
@@ -416,10 +416,10 @@ pub trait TryInto<T>: Sized {
416416/// // and handling the truncation after the fact.
417417/// let smaller_number = big_number as i32;
418418/// assert_eq!(smaller_number, -727379968);
419- ///
419+ ///
420420/// let try_smaller_number = i32::try_from(big_number);
421421/// assert!(try_smaller_number.is_err());
422- ///
422+ ///
423423/// let try_successful_smaller_number = i32::try_from(3);
424424/// assert!(try_successful_smaller_number.is_ok());
425425/// ```
0 commit comments