From: Dirk Behme <dirk.behme@de.bosch.com>
To: Nell Shamrell-Harrington <nells@linux.microsoft.com>,
<ojeda@kernel.org>, <alex.gaynor@gmail.com>, <wedsonaf@gmail.com>
Cc: <boqun.feng@gmail.com>, <gary@garyguo.net>,
<bjorn3_gh@protonmail.com>, <benno.lossin@proton.me>,
<a.hindborg@samsung.com>, <aliceryhl@google.com>,
<tmgross@umich.edu>, <linux@obei.io>, <kernel@valentinobst.de>,
<kent.overstreet@gmail.com>, <matthew.d.roper@intel.com>,
<kartikprajapati987@gmail.com>, <rust-for-linux@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rust: Adds examples for the `Either` type
Date: Tue, 17 Sep 2024 10:35:20 +0200 [thread overview]
Message-ID: <1037016e-d3fc-45a5-9607-38ca85eeb65c@de.bosch.com> (raw)
In-Reply-To: <20240916233507.11779-1-nells@linux.microsoft.com>
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.
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Signed-off-by: Nell Shamrell-Harrington <nells@linux.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
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@de.bosch.com>
Thanks
Dirk
next prev parent reply other threads:[~2024-09-17 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 23:35 Nell Shamrell-Harrington
2024-09-17 8:35 ` Dirk Behme [this message]
2024-09-17 18:01 ` Nell Shamrell-Harrington
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1037016e-d3fc-45a5-9607-38ca85eeb65c@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=kartikprajapati987@gmail.com \
--cc=kent.overstreet@gmail.com \
--cc=kernel@valentinobst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@obei.io \
--cc=matthew.d.roper@intel.com \
--cc=nells@linux.microsoft.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®