Skip to content

Commit 55f9712

Browse files
committed
Auto merge of #39407 - GuillaumeGomez:convert_module, r=frewsxcv
Add missing url in convert module r? @frewsxcv
2 parents c869937 + 19c9f18 commit 55f9712

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/libcore/convert.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,33 @@
1818
//! support arguments of multiple types.
1919
//!
2020
//! - Impl the `As*` traits for reference-to-reference conversions
21-
//! - Impl the `Into` trait when you want to consume the value in the conversion
22-
//! - The `From` trait is the most flexible, useful for value _and_ reference conversions
23-
//! - The `TryFrom` and `TryInto` traits behave like `From` and `Into`, but allow for the
21+
//! - Impl the [`Into`] trait when you want to consume the value in the conversion
22+
//! - The [`From`] trait is the most flexible, useful for value _and_ reference conversions
23+
//! - The [`TryFrom`] and [`TryInto`] traits behave like [`From`] and [`Into`], but allow for the
2424
//! conversion to fail
2525
//!
26-
//! As a library author, you should prefer implementing `From<T>` or `TryFrom<T>` rather than
27-
//! `Into<U>` or `TryInto<U>`, as `From` and `TryFrom` provide greater flexibility and offer
28-
//! equivalent `Into` or `TryInto` implementations for free, thanks to a blanket implementation
26+
//! As a library author, you should prefer implementing [`From<T>`][`From`] or
27+
//! [`TryFrom<T>`][`TryFrom`] rather than [`Into<U>`][`Into`] or [`TryInto<U>`][`TryInto`],
28+
//! as [`From`] and [`TryFrom`] provide greater flexibility and offer
29+
//! equivalent [`Into`] or [`TryInto`] implementations for free, thanks to a blanket implementation
2930
//! in the standard library.
3031
//!
3132
//! # Generic impl
3233
//!
33-
//! - `AsRef` and `AsMut` auto-dereference if the inner type is a reference
34-
//! - `From<U> for T` implies `Into<T> for U`
35-
//! - `TryFrom<U> for T` implies `TryInto<T> for U`
36-
//! - `From` and `Into` are reflexive, which means that all types can `into()`
34+
//! - [`AsRef`] and [`AsMut`] auto-dereference if the inner type is a reference
35+
//! - [`From`]`<U> for T` implies [`Into`]`<T> for U`
36+
//! - [`TryFrom`]`<U> for T` implies [`TryInto`]`<T> for U`
37+
//! - [`From`] and [`Into`] are reflexive, which means that all types can `into()`
3738
//! themselves and `from()` themselves
3839
//!
3940
//! See each trait for usage examples.
41+
//!
42+
//! [`Into`]: trait.Into.html
43+
//! [`From`]: trait.From.html
44+
//! [`TryFrom`]: trait.TryFrom.html
45+
//! [`TryInto`]: trait.TryInto.html
46+
//! [`AsRef`]: trait.AsRef.html
47+
//! [`AsMut`]: trait.AsMut.html
4048
4149
#![stable(feature = "rust1", since = "1.0.0")]
4250

0 commit comments

Comments
 (0)