19
19
//!
20
20
//! - Impl the `As*` traits for reference-to-reference conversions
21
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 values _and_ references conversions
22
+ //! - The `From` trait is the most flexible, useful for value _and_ reference conversions
23
23
//!
24
- //! As a library writer , you should prefer implementing `From<T>` rather than
25
- //! `Into<U>`, as `From` provides greater flexibility and offer the equivalent `Into`
24
+ //! As a library author , you should prefer implementing `From<T>` rather than
25
+ //! `Into<U>`, as `From` provides greater flexibility and offers an equivalent `Into`
26
26
//! implementation for free, thanks to a blanket implementation in the standard library.
27
27
//!
28
28
//! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated
29
- //! method which return an `Option<T>` or a `Result<T, E>`.
29
+ //! method which returns an `Option<T>` or a `Result<T, E>`.
30
30
//!
31
31
//! # Generic impl
32
32
//!
@@ -49,7 +49,7 @@ use marker::Sized;
49
49
/// [book]: ../../book/borrow-and-asref.html
50
50
///
51
51
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
52
- /// return an `Option<T>` or a `Result<T, E>`.
52
+ /// returns an `Option<T>` or a `Result<T, E>`.
53
53
///
54
54
/// # Examples
55
55
///
@@ -82,7 +82,7 @@ pub trait AsRef<T: ?Sized> {
82
82
/// A cheap, mutable reference-to-mutable reference conversion.
83
83
///
84
84
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
85
- /// return an `Option<T>` or a `Result<T, E>`.
85
+ /// returns an `Option<T>` or a `Result<T, E>`.
86
86
///
87
87
/// # Generic Impls
88
88
///
@@ -99,10 +99,10 @@ pub trait AsMut<T: ?Sized> {
99
99
/// A conversion that consumes `self`, which may or may not be expensive.
100
100
///
101
101
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
102
- /// return an `Option<T>` or a `Result<T, E>`.
102
+ /// returns an `Option<T>` or a `Result<T, E>`.
103
103
///
104
- /// Library writer should not implement directly this trait, but should prefer the implementation
105
- /// of the `From` trait, which offer greater flexibility and provide the equivalent `Into`
104
+ /// Library authors should not directly implement this trait, but should prefer implementing
105
+ /// the `From` trait, which offers greater flexibility and provides an equivalent `Into`
106
106
/// implementation for free, thanks to a blanket implementation in the standard library.
107
107
///
108
108
/// # Examples
@@ -134,7 +134,7 @@ pub trait Into<T>: Sized {
134
134
/// Construct `Self` via a conversion.
135
135
///
136
136
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
137
- /// return an `Option<T>` or a `Result<T, E>`.
137
+ /// returns an `Option<T>` or a `Result<T, E>`.
138
138
///
139
139
/// # Examples
140
140
///
0 commit comments