rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>
Cc: "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 22:28:08 +0200	[thread overview]
Message-ID: <DA6DJEG780UH.3FURKORQ8OY6U@kernel.org> (raw)
In-Reply-To: <CANiq72nNX++eUKAHYvxMvEeHy6cfDP98cteVAgM7RuQH5hDkVg@mail.gmail.com>

On Mon May 26, 2025 at 12:33 PM CEST, Miguel Ojeda wrote:
> On Mon, May 26, 2025 at 10:18 AM Benno Lossin <lossin@kernel.org> wrote:
>>
>> 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.
>
> Yeah, I thought if perhaps we could have a better method (extension
> trait) for these cases, at least for unit tests. On the other hand, if
> it is just for unit tests, we are back at using something that is not
> "real code", which is what triggered this patch (but at least it would
> not panic).

Having thought about this more, I think this is fine. I don't know which
extension function we would add to make this nicer.

---
Cheers,
Benno

  reply	other threads:[~2025-05-26 20:28 UTC|newest]

Thread overview: 6+ 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
2025-05-26 10:33   ` Miguel Ojeda
2025-05-26 20:28     ` Benno Lossin [this message]
2025-05-27  1:12       ` Albin Babu Varghese
2025-05-27  0:53   ` 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=DA6DJEG780UH.3FURKORQ8OY6U@kernel.org \
    --to=lossin@kernel.org \
    --cc=albinbabuvarghese20@gmail.com \
    --cc=miguel.ojeda.sandonis@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).