diff options
| author | bors <bors@rust-lang.org> | 2023-12-30 16:37:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-30 16:37:36 +0000 |
| commit | c6aeb28a7b42e1c19e4ecbe60422c3fac0ee2895 (patch) | |
| tree | e0a64d1bd88d279f29b7c20bb39829368b7a113e /tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs | |
| parent | b19b5f293edfeca3d03707c39e8289348ce1ba24 (diff) | |
| parent | c4a80f2e3e8375ff54826840e2e2a5c53a20e2ce (diff) | |
| download | rust-c6aeb28a7b42e1c19e4ecbe60422c3fac0ee2895.tar.gz rust-c6aeb28a7b42e1c19e4ecbe60422c3fac0ee2895.zip | |
Auto merge of #11865 - yuxqiu:map_unwrap_or_default, r=Jarcho
feat: add `manual_is_variant_and` lint changelog: add a new lint [`manual_is_variant_and`]. - Replace `option.map(f).unwrap_or_default()` and `result.map(f).unwrap_or_default()` with `option.is_some_and(f)` and `result.is_ok_and(f)` where `f` is a function or closure that returns `bool`. - MSRV is set to 1.70.0 for this lint; when `is_some_and` and `is_ok_and` was stabilised --- For example, for the following code: ```rust let opt = Some(0); opt.map(|x| x > 1).unwrap_or_default(); ``` It suggests to instead write: ```rust let opt = Some(0); opt.is_some_and(|x| x > 1) ```
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs')
0 files changed, 0 insertions, 0 deletions
