Return a closure from a function
问题 Note that this question pertains to a version of Rust before 1.0 was released Do I understand correctly that it is now impossible to return a closure from a function, unless it was provided to the function in its arguments? It is very useful approach, for example, when I need the same block of code, parameterized differently, in different parts of program. Currently the compiler does not allow something like this, naturally: fn make_adder(i: int) -> |int| -> int { |j| i + j } The closure is