about summary refs log tree commit diff
path: root/src/rustllvm/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2020-04-08 15:50:20 +0200
committerGitHub <noreply@github.com>2020-04-08 15:50:20 +0200
commita1e49f962c4678dce8d95a3968f120d6162a0ba1 (patch)
tree6baf009b22a55c4f41e5d49e4c327e664e53190b /src/rustllvm/CoverageMappingWrapper.cpp
parent5ea477143318468460acde5495f69fe8855c456e (diff)
parent5d54fbb7914cc1ea5b3bd8cdfd6f24dbacd8f649 (diff)
downloadrust-a1e49f962c4678dce8d95a3968f120d6162a0ba1.tar.gz
rust-a1e49f962c4678dce8d95a3968f120d6162a0ba1.zip
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)
Diffstat (limited to 'src/rustllvm/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions