1 2 3 4 5 6 7 8 9 10 11 12
pub trait FnBox { fn call(self: Box<Self>); } impl<T> FnBox for T where T: FnOnce(), { fn call(self: Box<Self>) { self() } }