8

Implement if-let match guards

 3 years ago
source link: https://github.com/rust-lang/rust/pull/79051
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Member

LeSeulArtichaut commented on Nov 15

edited

Implements rust-lang/rfcs#2294 (tracking issue: #51114).

I probably should do a few more things before this can be merged:

  • Add tests (added basic tests, more advanced tests could be done in the future?)
  • Add lint for exhaustive if-let guard (comparable to normal if-let statements)
  • Fix clippy

However since this is a nightly feature maybe it's fine to land this and do those steps in follow-up PRs.

Thanks a lot @matthewjasper heart for helping me with lowering to MIR! Would you be interested in reviewing this?
r? @ghost for now


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK