diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-03-10 08:01:32 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-10 08:01:32 +0900 |
| commit | 1c3fea2f8c167451f3f23b9a48463bd1fed836ae (patch) | |
| tree | 200249d518c76d6a72b3eb344606ba7643b90320 /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | 48a393e10bb17a5f123d24bfddc9fbb034f0cc10 (diff) | |
| parent | 1cc8c4de6aa0549a3d7d1da23ba48d34d0efd7bf (diff) | |
| download | rust-1c3fea2f8c167451f3f23b9a48463bd1fed836ae.tar.gz rust-1c3fea2f8c167451f3f23b9a48463bd1fed836ae.zip | |
Rollup merge of #82849 - camsteffen:option-get-or-default, r=joshtriplett
Add Option::get_or_default Tracking issue: #82901 The original issue is #55042, which was closed, but for an invalid reason (see discussion there). Opening this to reconsider (I hope that's okay). It seems like the only gap for `Option` being "entry-like". I ran into a need for this method where I had a `Vec<Option<MyData>>` and wanted to do `vec[n].get_or_default().my_data_method()`. Using an `Option` as an inner component of a data structure is probably where the need for this will normally arise.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
0 files changed, 0 insertions, 0 deletions
