@@ -205,11 +205,12 @@ pub trait AsMut<T: ?Sized> {
205
205
/// A value-to-value conversion that consumes the input value. The
206
206
/// opposite of [`From`].
207
207
///
208
- /// One should only implement [`Into`] if a conversion to a type outside the current crate is
209
- /// required. Otherwise one should always prefer implementing [`From`] over [`Into`] because
210
- /// implementing [`From`] automatically provides one with a implementation of [`Into`] thanks to
211
- /// the blanket implementation in the standard library. [`From`] cannot do these type of
212
- /// conversions because of Rust's orphaning rules.
208
+ /// One should avoid implementing [`Into`] and implement [`From`] instead.
209
+ /// Implementing [`From`] automatically provides one with an implementation of [`Into`]
210
+ /// thanks to the blanket implementation in the standard library.
211
+ ///
212
+ /// Prefer using [`Into`] over [`From`] when specifying trait bounds on a generic function
213
+ /// to ensure that types that only implement [`Into`] can be used as well.
213
214
///
214
215
/// **Note: This trait must not fail**. If the conversion can fail, use [`TryInto`].
215
216
///
@@ -218,7 +219,7 @@ pub trait AsMut<T: ?Sized> {
218
219
/// - [`From`]`<T> for U` implies `Into<U> for T`
219
220
/// - [`Into`] is reflexive, which means that `Into<T> for T` is implemented
220
221
///
221
- /// # Implementing [`Into`] for conversions to external types
222
+ /// # Implementing [`Into`] for conversions to external types in old versions of Rust
222
223
///
223
224
/// Prior to Rust 1.40, if the destination type was not part of the current crate
224
225
/// then you couldn't implement [`From`] directly.
@@ -248,9 +249,6 @@ pub trait AsMut<T: ?Sized> {
248
249
/// (as [`From`] does with [`Into`]). Therefore, you should always try to implement [`From`]
249
250
/// and then fall back to [`Into`] if [`From`] can't be implemented.
250
251
///
251
- /// Prefer using [`Into`] over [`From`] when specifying trait bounds on a generic function
252
- /// to ensure that types that only implement [`Into`] can be used as well.
253
- ///
254
252
/// # Examples
255
253
///
256
254
/// [`String`] implements [`Into`]`<`[`Vec`]`<`[`u8`]`>>`:
0 commit comments