std: Make consistence between From and Into
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
parent
7e552b46af
commit
b6c2a429ef
1 changed files with 2 additions and 2 deletions
|
|
@ -464,8 +464,8 @@ pub trait Into<T>: Sized {
|
|||
/// orphaning rules.
|
||||
/// See [`Into`] for more details.
|
||||
///
|
||||
/// Prefer using [`Into`] over using `From` when specifying trait bounds on a generic function.
|
||||
/// This way, types that directly implement [`Into`] can be used as arguments as well.
|
||||
/// Prefer using [`Into`] over [`From`] when specifying trait bounds on a generic function
|
||||
/// to ensure that types that only implement [`Into`] can be used as well.
|
||||
///
|
||||
/// The `From` trait is also very useful when performing error handling. When constructing a function
|
||||
/// that is capable of failing, the return type will generally be of the form `Result<T, E>`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue