File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -597,6 +597,9 @@ pub trait From<T>: Sized {
597
597
/// standard library. For more information on this, see the
598
598
/// documentation for [`Into`].
599
599
///
600
+ /// Prefer using [`TryInto`] over [`TryFrom`] when specifying trait bounds on a generic function
601
+ /// to ensure that types that only implement [`TryInto`] can be used as well.
602
+ ///
600
603
/// # Implementing `TryInto`
601
604
///
602
605
/// This suffers the same restrictions and reasoning as implementing
@@ -636,6 +639,9 @@ pub trait TryInto<T>: Sized {
636
639
/// When the [`!`] type is stabilized [`Infallible`] and [`!`] will be
637
640
/// equivalent.
638
641
///
642
+ /// Prefer using [`TryInto`] over [`TryFrom`] when specifying trait bounds on a generic function
643
+ /// to ensure that types that only implement [`TryInto`] can be used as well.
644
+ ///
639
645
/// `TryFrom<T>` can be implemented as follows:
640
646
///
641
647
/// ```
You can’t perform that action at this time.
0 commit comments