aboutsummaryrefslogtreecommitdiffstats
path: root/samples/rust/rust_driver_auxiliary.rs
diff options
context:
space:
mode:
authorAlbin Babu Varghese <[email protected]>2025-05-27 20:49:28 +0000
committerMiguel Ojeda <[email protected]>2025-06-23 23:01:12 +0000
commitb61b0092eaf22ef34936516d2e7181bb9cee25ac (patch)
tree3f8383874bdc00085db7dba8ef8dc4fcef6ea0d8 /samples/rust/rust_driver_auxiliary.rs
parentrust: kunit: use crate-level mapping for `c_void` (diff)
downloadkernel-b61b0092eaf22ef34936516d2e7181bb9cee25ac.tar.gz
kernel-b61b0092eaf22ef34936516d2e7181bb9cee25ac.zip
rust: list: replace unwrap() with ? in doctest examples
Using `unwrap()` in kernel doctests can cause panics on error and may give newcomers the mistaken impression that panicking is acceptable in kernel code. Replace all `.unwrap()` calls in `kernel::list` examples with `.ok_or(EINVAL)?` so that errors are properly propagated. Suggested-by: Miguel Ojeda <[email protected]> Link: https://github.com/Rust-for-Linux/linux/issues/1164 Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Albin Babu Varghese <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Danilo Krummrich <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded slightly. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'samples/rust/rust_driver_auxiliary.rs')
0 files changed, 0 insertions, 0 deletions