Re:Rust 1.25 released
by Buttons840 on Thursday March 29, 2018 @01:11PM
(#16708779)
Ok. It looks like the new feature allows library authors to express their intentions with simpler code, and thus error messages will also be simpler. Looks good, thanks for taking the time to answer my question.
[ Parent
| on HN ]
Re:Rust 1.25 released
by steveklabnik on Thursday March 29, 2018 @01:15PM
(#16708830)
No problem! It also does enable some other things too. For example, closures have a type that's not writable, so
fn foo() -> impl Fn(i32) -> i32 {
|x| x + 1
}
can be written, since closures implement the Fn trait, but there's no way to write the type directly.