]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: str: replace unwraps with question mark operators
authorDaniel Sedlak <daniel@sedlak.dev>
Sat, 23 Nov 2024 09:50:31 +0000 (10:50 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:45:05 +0000 (23:45 +0100)
commitb6357e26865a25650e49c4eb5abe6ef57ae4ede1
tree67e858041de3d2848cb6eb9cc812f5994ac08d3e
parent57c1ccc7e71a2f08ef0c1c525408195fb606bc36
rust: str: replace unwraps with question mark operators

Simplify the error handling by replacing unwraps with the question
mark operator. Furthermore, 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/
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Daniel Sedlak <daniel@sedlak.dev>
Link: https://lore.kernel.org/r/20241123095033.41240-5-daniel@sedlak.dev
[ Slightly reworded commit. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/str.rs