All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Albin Babu Varghese" <albinbabuvarghese20@gmail.com>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [[PATCH]] rust/list: replace unwrap() with ? in doctest examples
Date: Mon, 26 May 2025 10:18:30 +0200	[thread overview]
Message-ID: <DA5Y0QPY52WJ.DFA7YNSN2B2M@kernel.org> (raw)
In-Reply-To: <20250525225925.14797-1-albinbabuvarghese20@gmail.com>

Hi,

Thanks for the patch, a couple comments below.

The subject of your email starts with `[[PATCH]]`, normally we use
`[PATCH]` instead. Did you use `git send-email` and `git format-patch`?

On Mon May 26, 2025 at 12:59 AM CEST, Albin Babu Varghese wrote:
> Replace panicking `unwrap()` calls in the `kernel::list` doctests with `ok_or(EINVAL)?` so they return a proper `Error` instead of panicking.

Commit messages should be wrapped to a sensible column length such as 72
characters.

Also this is missing the motivation that newcomers might get the
impression that calling `unwrap` is OK.

> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
>

No need for blank lines in the taglist.

> Link: https://github.com/Rust-for-Linux/linux/issues/1164
> Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
> ---
>  rust/kernel/list.rs | 38 +++++++++++++++++++-------------------
>  1 file changed, 19 insertions(+), 19 deletions(-)

The changes themselves look good, if we want to use the `ok_or` + error
combination. I haven't thought about this, so there might be something
better here, but it already is an improvement over the previous one.

Reviewed-by: Benno Lossin <lossin@kernel.org>

---
Cheers,
Benno

  reply	other threads:[~2025-05-26  8:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-25 22:59 [[PATCH]] rust/list: replace unwrap() with ? in doctest examples Albin Babu Varghese
2025-05-26  8:18 ` Benno Lossin [this message]
2025-05-26 10:33   ` Miguel Ojeda
2025-05-26 20:28     ` Benno Lossin
2025-05-27  1:12       ` Albin Babu Varghese
2025-05-27  0:53   ` Albin Babu Varghese
  -- strict thread matches above, loose matches on Subject: below --
2025-05-25 22:34 Albin Babu Varghese

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=DA5Y0QPY52WJ.DFA7YNSN2B2M@kernel.org \
    --to=lossin@kernel.org \
    --cc=albinbabuvarghese20@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.