]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: rbtree: remove unwrap in asserts
authorDaniel Sedlak <daniel@sedlak.dev>
Sat, 23 Nov 2024 09:50:29 +0000 (10:50 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:44:29 +0000 (23:44 +0100)
commit3a518544829630d172b067be8697e018e258c445
tree3b1c1ddc4660e29c2b3a437e97eb8e4ca6d43502
parent7eeb0e7a50b8f13094f164c126ca9c0d75241d35
rust: rbtree: remove unwrap in asserts

Remove `unwrap` in asserts and replace it with `Option::Some`
matching. By doing it this way, the examples are more
descriptive, so it disambiguates the return type of
the `get(...)` and `next(...)`, because the `unwrap(...)`
can also be called on `Result`.

Signed-off-by: Daniel Sedlak <daniel@sedlak.dev>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20241123095033.41240-3-daniel@sedlak.dev
[ Reworded title slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/rbtree.rs