]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: init: replace unwraps with question mark operators
authorDaniel Sedlak <daniel@sedlak.dev>
Sat, 23 Nov 2024 09:50:28 +0000 (10:50 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:44:13 +0000 (23:44 +0100)
commit7eeb0e7a50b8f13094f164c126ca9c0d75241d35
tree7e90c2d559b4f46d2d5d230ccd5fa1cdfa209b9b
parent0730422bced5e8325fb6806d9a80bb10673588e6
rust: init: replace unwraps with question mark operators

Use `?` operator in the doctests. Since it is in the examples,
using unwraps can convey a wrong impression that unwrapping is
fine in general, thus this patch removes this unwrapping.

Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/CANiq72nsK1D4NuQ1U7NqMWoYjXkqQSj4QuUEL98OmFbq022Z9A@mail.gmail.com/
Signed-off-by: Daniel Sedlak <daniel@sedlak.dev>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20241123095033.41240-2-daniel@sedlak.dev
[ Reworded commit slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/init.rs