An inner function defined with fn attempts to access variables from its enclosing scope, which is not permitted. Use a closure instead of an inner fn to capture the surrounding environment.
E0434
rust An inner function defined with fn attempts to access variables from its enclosing scope, which is not permitted. Use a closure instead of an inner fn to capture the surrounding environment.