]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #87196 - oxalica:option-insert-must-use, r=joshtriplett
authorbors <bors@rust-lang.org>
Mon, 19 Jul 2021 07:03:36 +0000 (07:03 +0000)
committerbors <bors@rust-lang.org>
Mon, 19 Jul 2021 07:03:36 +0000 (07:03 +0000)
commit83f08223a90b71f59e5dc5f38e384a49a76c8452
treebd43202e46c3f75762d66a6d5be1820dd5204eb8
parent0ecff8c623fa29cccad6f946c657e81dacd85847
parent774a79e3fd40dee6dcdb80ef57e9e49a6d38d381
Auto merge of #87196 - oxalica:option-insert-must-use, r=joshtriplett

Mark `Option::insert` as must_use

Some people seems misled by the function name and use it in case where a simple assignment just works.
If the return value is not used, `option = Some(value);` should be preferred instead of `option.insert(value);`
library/core/src/option.rs