diff options
| author | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-05-08 18:09:29 +0800 |
|---|---|---|
| committer | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-05-08 18:09:29 +0800 |
| commit | b6c2a429efd85cbfa5f592c66faac6955729c6ea (patch) | |
| tree | 4f09420c419b71e8a897c2d4ef9f4ff2919dea44 | |
| parent | 7e552b46af72df390ed233b58a7f51650515b2a8 (diff) | |
| download | rust-b6c2a429efd85cbfa5f592c66faac6955729c6ea.tar.gz rust-b6c2a429efd85cbfa5f592c66faac6955729c6ea.zip | |
std: Make consistence between `From` and `Into`
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
| -rw-r--r-- | library/core/src/convert/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index e1b10e1074d..ef184e1ceb4 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -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>`. |
