mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
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.
This commit is contained in:
commit
2567d0f883
@ -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
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user