rust-clippy/clippy_lints
Philipp Krones a1e49f962c
Rollup merge of #5415 - nickrtorres:master, r=flip1995
Add new lint for `Result<T, E>.map_or(None, Some(T))`

Fixes #5414

PR Checklist
---
- [x] Followed lint naming conventions (the name is a bit awkward, but it seems to conform)
- [x] Added passing UI tests (including committed .stderr file)
- [x] cargo test passes locally
- [x] Executed cargo dev update_lints
- [x] Added lint documentation
- [x] Run cargo dev fmt

`Result<T, E>` has an [`ok()`](https://doc.rust-lang.org/std/result/enum.Result.html#method.ok) method that adapts a `Result<T,E>` into an `Option<T>`.
It's possible to get around this adapter by writing `Result<T,E>.map_or(None, Some)`.

This lint is implemented as a new variant of the existing [`option_map_none` lint](https://github.com/rust-lang/rust-clippy/pull/2128)
2020-04-08 15:50:20 +02:00
..
src Rollup merge of #5415 - nickrtorres:master, r=flip1995 2020-04-08 15:50:20 +02:00
Cargo.toml Remove dependency on matches crate 2020-03-25 07:50:08 +01:00
README.md clippy_lints: readme: don't mention crates.io since it is no longer used to publish clippy. 2020-03-10 01:05:54 +01:00

This crate contains Clippy lints. For the main crate, check GitHub.