[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240917180103.GA16431@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Tue, 17 Sep 2024 11:01:03 -0700
From: Nell Shamrell-Harrington <nells@...ux.microsoft.com>
To: Dirk Behme <dirk.behme@...bosch.com>
Cc: ojeda@...nel.org, alex.gaynor@...il.com, wedsonaf@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...sung.com,
aliceryhl@...gle.com, tmgross@...ch.edu, linux@...i.io,
kernel@...entinobst.de, kent.overstreet@...il.com,
matthew.d.roper@...el.com, kartikprajapati987@...il.com,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rust: Adds examples for the `Either` type
On Tue, Sep 17, 2024 at 10:35:20AM +0200, Dirk Behme wrote:
> On 17.09.2024 01:35, Nell Shamrell-Harrington wrote:
> >Adds examples for the `Either` type
>
> You might want to check
>
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html
>
> "Describe your changes in imperative mood, e.g. “make xyzzy do
> frotz” instead of “[This patch] makes xyzzy do frotz” or
> “[I] changed xyzzy to do frotz”, as if you are giving orders to
> the codebase to change its behaviour."
>
> For example:
>
> [PATCH] rust: types: Add examples for the `Either` type
>
> Add examples for the `Either` types.
Will do!
>
>
> >Suggested-by: Miguel Ojeda <ojeda@...nel.org>
> >Signed-off-by: Nell Shamrell-Harrington <nells@...ux.microsoft.com>
> >---
> > rust/kernel/types.rs | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> >diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs
> >index 9e7ca066355c..f22f6e289198 100644
> >--- a/rust/kernel/types.rs
> >+++ b/rust/kernel/types.rs
> >@@ -461,6 +461,12 @@ fn drop(&mut self) {
> > }
> > /// A sum type that always holds either a value of type `L` or `R`.
>
> It looks to me that the default is to add
>
> /// # Examples
Thank you, I will add this in and resubmit the patch.
>
> followed by some verbose explanation before the test code below.
>
> >+/// ```
> >+/// use kernel::types::Either;
> >+///
> >+/// let left_value: Either<i32, &str> = Either::Left(7);
> >+/// let right_value: Either<i32, &str> = Either::Right("right value");
> >+/// ```
>
> I ran that on the the target and got:
>
> # rust_doctest_kernel_types_rs_3.location: rust/kernel/types.rs:485
> ok 107 rust_doctest_kernel_types_rs_3
>
> So:
>
> Tested-by: Dirk Behme <dirk.behme@...bosch.com>
Thank you for doing this, I appreciate you taking the time!
>
> Thanks
>
> Dirk
>
>
Powered by blists - more mailing lists