mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-12 06:53:05 +00:00
![]() Use pattern matching instead of checking lengths explicitly This piece of code checks that there are exaclty two variants, one having exactly one field, the other having exactly zero fields. If any of these conditions is violated, it returns `None`. Otherwise it assigns that one field's ty to `field_ty`. Instead of fiddling with indices and length checks explicitly, use pattern matching to simplify this. `@rustbot` modify labels +C-cleanup +T-compiler |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |