3 ms·
"The if let construct is based on the precedent set by Swift," https://github.com/rust-lang/rfcs/blob/master/text/0160-if-let.md https://github.com/rust-lang/r
by CUViper 12y ago
"The if let construct is based on the precedent set by Swift,"
https://github.com/rust-lang/rfcs/blob/master/text/0160-if-let.md https://github.com/rust-lang/rfcs/blob/master/text/0160-if-l...
- oleganza 12y agoWow. Such a rapid feedback loop here. Thanks for sharing.
- eridius 12y agoThat's putting it a bit mildly. Speaking as the author of that RFC, Rust's "if let" would never have existed if it were not for Swift. When I saw Swift's "if let" I immediately knew I wanted it in Rust. I also generalized it to arbitrary patterns at that time, since Rust doesn't fetishize Option the way Swift fetishizes Optional. I am glad to see Swift 1.2 expanding "if let" to multiple clauses. But I do wish it supported arbitrary values instead of just Optional.