Skip to content

Commit

Permalink
Ignore manual_map clippy lint
Browse files Browse the repository at this point in the history
For generic functions which are instantiated a lot, we can generate less
LLVM IR and compile faster by handrolling Option::map.

    warning: manual implementation of `Option::map`
        --> src/punctuated.rs:1092:15
         |
    1092 |           last: match punctuated.last {
         |  _______________^
    1093 | |             Some(t) => Some(Box::new(f(fold, *t))),
    1094 | |             None => None,
    1095 | |         },
         | |_________^ help: try: `punctuated.last.map(|t| Box::new(f(fold, *t)))`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
         = note: `-W clippy::manual-map` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::manual_map)]`
  • Loading branch information
dtolnay committed May 19, 2024
1 parent 7273aa7 commit 3dfacc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
clippy::let_underscore_untyped, // https://github.com/rust-lang/rust-clippy/issues/10410
clippy::manual_assert,
clippy::manual_let_else,
clippy::manual_map,
clippy::match_like_matches_macro,
clippy::match_on_vec_items,
clippy::match_same_arms,
Expand Down

0 comments on commit 3dfacc1

Please sign in to comment.