diff options
| author | bors <bors@rust-lang.org> | 2023-11-23 10:00:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-23 10:00:06 +0000 |
| commit | 840e227bb6eadb2a01f2344e41ef57bcde6cfa6f (patch) | |
| tree | a44ca45a2af6fd4442c4bec1c51dde56b2c032c7 /clippy_lints/src/methods/mod.rs | |
| parent | 30c743f8a04d2ad35885eefaa8d29b19a0e3d013 (diff) | |
| parent | 5d330d08fb35cbed991df29ed94bad69c4f3a4df (diff) | |
Auto merge of #11845 - GuillaumeGomez:result_map_or_into_option-extension, r=flip1995
Extend `result_map_or_into_option` lint to handle `Result::map_or_else(|_| None, Some)` Fixes https://github.com/rust-lang/rust-clippy/issues/10365. As indicated in the title, it extends the `result_map_or_into_option` lint to handle `Result::map_or_else(|_| None, Some)`. changelog: extension of the `result_map_or_into_option` lint to handle `Result::map_or_else(|_| None, Some)` r? `@blyxyas`
Diffstat (limited to 'clippy_lints/src/methods/mod.rs')
| -rw-r--r-- | clippy_lints/src/methods/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 82cd3ac0486..71de77acfc1 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -81,6 +81,7 @@ mod read_line_without_trim; mod readonly_write_lock; mod redundant_as_str; mod repeat_once; +mod result_map_or_else_none; mod search_is_some; mod seek_from_current; mod seek_to_start_instead_of_rewind; @@ -4335,6 +4336,9 @@ impl Methods { option_map_or_none::check(cx, expr, recv, def, map); manual_ok_or::check(cx, expr, recv, def, map); }, + ("map_or_else", [def, map]) => { + result_map_or_else_none::check(cx, expr, recv, def, map); + }, ("next", []) => { if let Some((name2, recv2, args2, _, _)) = method_call(recv) { match (name2, args2) { |
