Skip to content

Commit

Permalink
Rollup merge of rust-lang#92541 - asquared31415:from-docs, r=m-ou-se
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Mar 9, 2022
2 parents fe6ad3c + 9054fbb commit 20f0542
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ pub trait Into<T>: Sized {
/// that encapsulate multiple error types. See the "Examples" section and [the book][book] for more
/// details.
///
/// **Note: This trait must not fail**. If the conversion can fail, use [`TryFrom`].
/// **Note: This trait must not fail**. The `From` trait is intended for perfect conversions.
/// If the conversion can fail or is not perfect, use [`TryFrom`].
///
/// # Generic Implementations
///
Expand Down

0 comments on commit 20f0542

Please sign in to comment.