You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also note that, unlike in many functional languages, |x| f(x) cannot always be replaced by f (η-reduction) in Rust as f(x) might involve one or more reference and one dereference of x (such as &***x). Those dereferences/reference won't happen automatically when using only the function name, which wants the exact signature as declared.
What it does
This lint replaces the introduction of a simple closure with the named function that is being used in said closure.
Lint Name
replace_mapped_closure_with_into
Category
complexity
Advantage
map
by introducing a common function name instead of a closure + identifierDrawbacks
Example
Could be written as:
The text was updated successfully, but these errors were encountered: