Implement Option::contains and Result::contains#62356
Implement Option::contains and Result::contains#62356bors merged 1 commit intorust-lang:masterfrom soc:topic/contains
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
I filed a tracking issue for you in #62358. |
|
This seems like quite a useful addition to me! I know I've wanted this a bunch of times and |
FWIW, I've always done |
|
r? @Centril |
|
@Centril Thanks! I'll squash the commits as soon as you are happy with the code. |
|
@soc It looks good to me so go ahead and squash now :) As for |
|
@soc Can you please apply @Mark-Simulacrum's suggestion in #62358 (comment)? |
Will do!
Agreed. I think there are also a few additional combinators that could be considered (like |
|
I usually use For the cases where it doesn't work it would be much more useful to implement heterogeneous comparisons |
|
@Centril Added |
|
@soc Seems you have some test failures (see https://dev.azure.com/rust-lang/rust/_build/results?buildId=2412). While fixing those, can you also address @fbstj's comment? -- Also, can you split |
|
@Centril Will do, thanks! |
|
@Centril Done! |
|
Thanks! r=me rollup when green |
This increases consistency with other common data structures.
|
@Centril Tests are green! |
|
Thanks! @bors r+ rollup |
|
📌 Commit 6f76da4 has been approved by |
Implement Option::contains and Result::contains This increases consistency with other common data structures.
Implement Option::contains and Result::contains This increases consistency with other common data structures.
Rollup of 5 pull requests Successful merges: - #62356 (Implement Option::contains and Result::contains) - #62462 (Document `while` keyword) - #62472 (Normalize use of backticks in compiler messages p2) - #62477 (Re-add bootstrap attribute to libunwind for llvm-libunwind feature) - #62478 (normalize use of backticks for compiler messages in librustc_codegen) Failed merges: r? @ghost
This increases consistency with other common data structures.