linux/rust
Miguel Ojeda dee1396a48 rust: init: simplify from map_err to inspect_err
A new complexity lint, `manual_inspect` [1], has been introduced in
the upcoming Rust 1.81 (currently in nightly), which checks for uses of
`map*` which return the original item:

    error:
    --> rust/kernel/init.rs:846:23
        |
    846 |         (self.1)(val).map_err(|e| {
        |                       ^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
        = note: `-D clippy::manual-inspect` implied by `-D warnings`
        = help: to override `-D warnings` add `#[allow(clippy::manual_inspect)]`
    help: try
        |
    846 ~         (self.1)(val).inspect_err(|e| {
    847 |             // SAFETY: `slot` was initialized above.
    848 ~             unsafe { core::ptr::drop_in_place(slot) };
        |

Thus clean them up.

Link: https://rust-lang.github.io/rust-clippy/master/index.html#/manual_inspect [1]
Tested-by: Benno Lossin <benno.lossin@proton.me>
Tested-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20240709160615.998336-3-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-10 10:28:51 +02:00
..
bindings rust: add abstraction for struct page 2024-07-08 23:44:01 +02:00
kernel rust: init: simplify from map_err to inspect_err 2024-07-10 10:28:51 +02:00
macros rust: macros: indent list item in paste!'s docs 2024-07-10 10:28:51 +02:00
uapi net: phy: add Rust Asix PHY driver 2023-12-15 09:35:50 +00:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: Ignore preserve-most functions 2023-12-13 01:09:55 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: upgrade to Rust 1.73.0 2023-10-15 21:25:08 +02:00
exports.c rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c 2023-12-13 01:09:55 +01:00
helpers.c rust: add abstraction for struct page 2024-07-08 23:44:01 +02:00
Makefile kbuild: rust: remove now-unneeded rusttest custom sysroot handling 2024-07-08 22:39:39 +02:00