From fb2b918866e0457857c17f71911df31da1d2dac3 Mon Sep 17 00:00:00 2001 From: Jonas Pleyer Date: Sun, 3 Mar 2024 15:21:39 +0100 Subject: [PATCH 1/2] Small enhancement to description of From trait - fix small typo - avoid repetition of formulations --- library/core/src/convert/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 85740dce8668c..4dddf92b3e0be 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -466,9 +466,9 @@ pub trait Into: Sized { /// 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. /// -/// The `From` is also very useful when performing error handling. When constructing a function +/// 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`. -/// The `From` trait simplifies error handling by allowing a function to return a single error type +/// It simplifies error handling by allowing a function to return a single error type /// that encapsulate multiple error types. See the "Examples" section and [the book][book] for more /// details. /// From e46306043b8e8270b1cace5bec7cd563e8ea9ae1 Mon Sep 17 00:00:00 2001 From: Jonas Pleyer <59249415+jonaspleyer@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:04:46 +0100 Subject: [PATCH 2/2] include feedback from workingjubilee - Refer to trait directly - small typo in encapsulate Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- library/core/src/convert/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 4dddf92b3e0be..63fd23ea9a9d3 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -468,8 +468,8 @@ pub trait Into: Sized { /// /// 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`. -/// It simplifies error handling by allowing a function to return a single error type -/// that encapsulate multiple error types. See the "Examples" section and [the book][book] for more +/// `From` simplifies error handling by allowing a function to return a single error type +/// that encapsulates multiple error types. See the "Examples" section and [the book][book] for more /// details. /// /// **Note: This trait must not fail**. The `From` trait is intended for perfect conversions.