Skip to content

Commit 2567d0f

Browse files
authored
Rollup merge of #92541 - asquared31415:from-docs, r=m-ou-se
Mention intent of `From` trait in its docs This pr is a docs modification to add to the documentation of the `From` trait a note about its intent as a perfect conversion. This is already stated in the `TryFrom` docs so this is simply adding that information in a more visible way.
2 parents c025962 + 9054fbb commit 2567d0f

File tree

1 file changed

+2
-1
lines changed
  • library/core/src/convert

1 file changed

+2
-1
lines changed

library/core/src/convert/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ pub trait Into<T>: Sized {
300300
/// that encapsulate multiple error types. See the "Examples" section and [the book][book] for more
301301
/// details.
302302
///
303-
/// **Note: This trait must not fail**. If the conversion can fail, use [`TryFrom`].
303+
/// **Note: This trait must not fail**. The `From` trait is intended for perfect conversions.
304+
/// If the conversion can fail or is not perfect, use [`TryFrom`].
304305
///
305306
/// # Generic Implementations
306307
///

0 commit comments

Comments
 (0)