New lint: mem_replace_option_with_some (#14197)

`mem::replace(opt, Some(v))` can be replaced by `opt.replace(v)`.

Close #14195

changelog: [`mem_replace_option_with_some`]: new lint
This commit is contained in:
llogiq 2025-02-12 19:02:06 +00:00 committed by GitHub
commit 4129f5c824
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 183 additions and 39 deletions

View file

@ -58,6 +58,7 @@ msrv_aliases! {
1,35,0 { OPTION_COPIED, RANGE_CONTAINS }
1,34,0 { TRY_FROM }
1,33,0 { UNDERSCORE_IMPORTS }
1,31,0 { OPTION_REPLACE }
1,30,0 { ITERATOR_FIND_MAP, TOOL_ATTRIBUTES }
1,29,0 { ITER_FLATTEN }
1,28,0 { FROM_BOOL, REPEAT_WITH }