Rust for Linux List
 help / color / mirror / Atom feed
From: Daniel Sedlak <daniel@sedlak.dev>
To: Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	rust-for-linux@vger.kernel.org,
	"Daniel Sedlak" <daniel@sedlak.dev>
Subject: [PATCH 0/2] Replace unwraps in doctests with graceful handling
Date: Sat, 16 Nov 2024 20:46:16 +0100	[thread overview]
Message-ID: <20241116195221.373332-1-daniel@sedlak.dev> (raw)

There are multiple occurrences where we use unwraps (or other panickable behavior)
within documentation tests. In the following patches, I try to replace at least some
of the occurrences with graceful handling. I haven't touched the rest (yet),
since I am unsure whether we will all agree on this. If we agree on the handling
I can submit them in v2 or as a follow patches.

Daniel Sedlak (2):
  rust: kernel: init: replace unwraps with the question mark operators
  rust: kernel: rbtree: replace unwraps with functional programming
    paradigms

 rust/kernel/init.rs   |  6 ++--
 rust/kernel/rbtree.rs | 78 ++++++++++++++++++++++---------------------
 2 files changed, 44 insertions(+), 40 deletions(-)

-- 
2.47.0


             reply	other threads:[~2024-11-16 19:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16 19:46 Daniel Sedlak [this message]
2024-11-16 19:46 ` [PATCH 1/2] rust: kernel: init: replace unwraps with the question mark operators Daniel Sedlak
2024-11-17  7:34   ` Dirk Behme
2024-11-17 17:38     ` Daniel Sedlak
2024-11-16 19:46 ` [PATCH 2/2] rust: kernel: rbtree: replace unwraps with functional programming paradigms Daniel Sedlak
2024-11-16 21:28   ` Miguel Ojeda
2024-11-17 18:36     ` Daniel Sedlak
2024-11-17 20:33       ` Miguel Ojeda
2024-11-18 20:04         ` Daniel Sedlak
2024-11-16 20:01 ` [PATCH 0/2] Replace unwraps in doctests with graceful handling Miguel Ojeda
2024-11-17 17:17   ` Daniel Sedlak
2024-11-17 20:06     ` Miguel Ojeda

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=20241116195221.373332-1-daniel@sedlak.dev \
    --to=daniel@sedlak.dev \
    --cc=a.hindborg@kernel.org \
    --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=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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