Skip to content

Commit a0cd465

Browse files
committed
Doc:std::convert: disambiguate traits and keywords
1 parent 6cda8e4 commit a0cd465

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libcore/convert.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
//! Like many traits, these are often used as bounds for generic functions, to
1818
//! support arguments of multiple types.
1919
//!
20-
//! - Use `as` for reference-to-reference conversions
21-
//! - Use `into` when you want to consume the value
22-
//! - `from` is the more flexible way, which can convert values and references
20+
//! - 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, usefull for values _and_ references conversions
2323
//!
2424
//! As a library writer, you should prefer implementing `From<T>` rather than
2525
//! `Into<U>`, as `From` provides greater flexibility and offer the equivalent `Into`
26-
//! implementation for free thanks to a blanket implementation in the standard library.
26+
//! implementation for free, thanks to a blanket implementation in the standard library.
2727
//!
2828
//! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated
2929
//! method which return an `Option<T>` or a `Result<T, E>`.
@@ -103,7 +103,7 @@ pub trait AsMut<T: ?Sized> {
103103
///
104104
/// Library writer should not implement directly this trait, but should prefer the implementation
105105
/// of the `From` trait, which offer greater flexibility and provide the equivalent `Into`
106-
/// implementation for free thanks to a blanket implementation in the standard library.
106+
/// implementation for free, thanks to a blanket implementation in the standard library.
107107
///
108108
/// # Examples
109109
///
@@ -119,7 +119,7 @@ pub trait AsMut<T: ?Sized> {
119119
/// is_hello(s);
120120
/// ```
121121
///
122-
/// #Generic Impls
122+
/// # Generic Impls
123123
///
124124
/// - `From<T> for U` implies `Into<U> for T`
125125
/// - `into()` is reflexive, which means that `Into<T> for T` is implemented

0 commit comments

Comments
 (0)