From a0cd46554d850d99f985be911215ac41978533a2 Mon Sep 17 00:00:00 2001 From: Thomas Wickham Date: Sun, 31 Jan 2016 12:26:15 +0100 Subject: [PATCH] Doc:std::convert: disambiguate traits and keywords --- src/libcore/convert.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index f67bfe34e8f6..c207ad16595d 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -17,13 +17,13 @@ //! Like many traits, these are often used as bounds for generic functions, to //! support arguments of multiple types. //! -//! - Use `as` for reference-to-reference conversions -//! - Use `into` when you want to consume the value -//! - `from` is the more flexible way, which can convert values and references +//! - Impl the `As*` traits for reference-to-reference conversions +//! - Impl the `Into` trait when you want to consume the value in the conversion +//! - The `From` trait is the most flexible, usefull for values _and_ references conversions //! //! As a library writer, you should prefer implementing `From` rather than //! `Into`, as `From` provides greater flexibility and offer the equivalent `Into` -//! implementation for free thanks to a blanket implementation in the standard library. +//! implementation for free, thanks to a blanket implementation in the standard library. //! //! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated //! method which return an `Option` or a `Result`. @@ -103,7 +103,7 @@ pub trait AsMut { /// /// Library writer should not implement directly this trait, but should prefer the implementation /// of the `From` trait, which offer greater flexibility and provide the equivalent `Into` -/// implementation for free thanks to a blanket implementation in the standard library. +/// implementation for free, thanks to a blanket implementation in the standard library. /// /// # Examples /// @@ -119,7 +119,7 @@ pub trait AsMut { /// is_hello(s); /// ``` /// -/// #Generic Impls +/// # Generic Impls /// /// - `From for U` implies `Into for T` /// - `into()` is reflexive, which means that `Into for T` is implemented