-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)
Description
We could have a ||
expression expand to &F
or &mut F
where F : Fn()
(FnMut
, etc), and not just F
. This would make it easier to write code that accepted boxed closures:
fn foo(x: &mut FnMut()) { ... }
foo(|| ...)
whereas today it is required to write:
foo(&mut || ...)
This seems like a pretty small delta and might go a long way towards improving ergonomic impact of the new closure design.
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)