This repository was archived by the owner on Jul 14, 2018. It is now read-only.
This repository was archived by the owner on Jul 14, 2018. It is now read-only.
Improved match ergonomics around references #24
Open
Description
Point of contact
Overview
Make match
easier to use and less boilerplate-y by auto-dereferencing in the condition expression and inferring ref
s in the patterns.
E.g.,
fn foo(x: &AnEnum) {
match x {
AnEnum::VariantA(y) => { ... }
AnEnum::VariantB(y, z) => { ... }
}
}
rather than (currently):
fn foo(x: &AnEnum) {
match *x {
AnEnum::VariantA(ref y) => { ... }
AnEnum::VariantB(ref y, ref z) => { ... }
}
}
Status
Accepted as RFC 2005.
cc #17