Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • init.rs
Find file BlameHistoryPermalink
  • Miguel Ojeda's avatar
    rust: init: simplify from `map_err` to `inspect_err` · dee1396a
    Miguel Ojeda authored Jul 09, 2024
    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: default avatarBenno Lossin <benno.lossin@proton.me>
    Tested-by: default avatarAndreas Hindborg <a.hindborg@samsung.com>
    Link: https://lore.kernel.org/r/20240709160615.998336-3-ojeda@kernel.org
    
    
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    dee1396a
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7