@@ -251,12 +251,12 @@ pub trait AsMut<T: ?Sized> {
251
251
///
252
252
/// # Examples
253
253
///
254
- /// [`String`] implements `Into< Vec<u8 >>`:
254
+ /// [`String`] implements [ `Into`]`<`[` Vec`]`<`[`u8`]` >>`:
255
255
///
256
256
/// In order to express that we want a generic function to take all arguments that can be
257
257
/// converted to a specified type `T`, we can use a trait bound of [`Into`]`<T>`.
258
258
/// For example: The function `is_hello` takes all arguments that can be converted into a
259
- /// `Vec<u8 >`.
259
+ /// [ `Vec`]`<`[`u8`]` >`.
260
260
///
261
261
/// ```
262
262
/// fn is_hello<T: Into<Vec<u8>>>(s: T) {
@@ -274,6 +274,7 @@ pub trait AsMut<T: ?Sized> {
274
274
/// [`String`]: ../../std/string/struct.String.html
275
275
/// [`From`]: trait.From.html
276
276
/// [`Into`]: trait.Into.html
277
+ /// [`Vec`]: ../../std/vec/struct.Vec.html
277
278
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
278
279
pub trait Into < T > : Sized {
279
280
/// Performs the conversion.
@@ -410,12 +411,12 @@ pub trait TryInto<T>: Sized {
410
411
///
411
412
/// This is useful when you are doing a type conversion that may
412
413
/// trivially succeed but may also need special handling.
413
- /// For example, there is no way to convert an `i64` into an `i32`
414
- /// using the [`From`] trait, because an `i64` may contain a value
415
- /// that an `i32` cannot represent and so the conversion would lose data.
416
- /// This might be handled by truncating the `i64` to an `i32` (essentially
417
- /// giving the `i64`'s value modulo `i32::MAX`) or by simply returning
418
- /// `i32::MAX`, or by some other method. The `From` trait is intended
414
+ /// For example, there is no way to convert an [ `i64`] into an [ `i32`]
415
+ /// using the [`From`] trait, because an [ `i64`] may contain a value
416
+ /// that an [ `i32`] cannot represent and so the conversion would lose data.
417
+ /// This might be handled by truncating the [ `i64`] to an [ `i32`] (essentially
418
+ /// giving the [ `i64`] 's value modulo [ `i32::MAX`] ) or by simply returning
419
+ /// [ `i32::MAX`] , or by some other method. The [ `From`] trait is intended
419
420
/// for perfect conversions, so the `TryFrom` trait informs the
420
421
/// programmer when a type conversion could go bad and lets them
421
422
/// decide how to handle it.
@@ -425,8 +426,8 @@ pub trait TryInto<T>: Sized {
425
426
/// - `TryFrom<T> for U` implies [`TryInto`]`<U> for T`
426
427
/// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
427
428
/// is implemented and cannot fail -- the associated `Error` type for
428
- /// calling `T::try_from()` on a value of type `T` is `Infallible`.
429
- /// When the `!` type is stablized `Infallible` and `!` will be
429
+ /// calling `T::try_from()` on a value of type `T` is [ `Infallible`] .
430
+ /// When the [ `!`] type is stablized [ `Infallible`] and [ `!`] will be
430
431
/// equivalent.
431
432
///
432
433
/// `TryFrom<T>` can be implemented as follows:
@@ -451,7 +452,7 @@ pub trait TryInto<T>: Sized {
451
452
///
452
453
/// # Examples
453
454
///
454
- /// As described, [`i32`] implements `TryFrom<i64>`:
455
+ /// As described, [`i32`] implements `TryFrom<`[` i64`]` >`:
455
456
///
456
457
/// ```
457
458
/// use std::convert::TryFrom;
@@ -474,6 +475,8 @@ pub trait TryInto<T>: Sized {
474
475
///
475
476
/// [`try_from`]: trait.TryFrom.html#tymethod.try_from
476
477
/// [`TryInto`]: trait.TryInto.html
478
+ /// [`i32::MAX`]: ../../std/i32/constant.MAX.html
479
+ /// [`!`]: ../../std/primitive.never.html
477
480
#[ stable( feature = "try_from" , since = "1.34.0" ) ]
478
481
pub trait TryFrom < T > : Sized {
479
482
/// The type returned in the event of a conversion error.
0 commit comments