2 Checks for functions that expect closures of type
3 Fn(...) -> Ord where the implemented closure returns the unit type.
4 The lint also suggests to remove the semi-colon at the end of the statement if present.
7 Likely, returning the unit type is unintentional, and
8 could simply be caused by an extra semi-colon. Since () implements Ord
9 it doesn't cause a compilation error.
10 This is the same reasoning behind the unit_cmp lint.
13 If returning unit is intentional, then there is no
14 way of specifying this without triggering needless_return lint
18 let mut twins = vec!((1, 1), (2, 2));
19 twins.sort_by_key(|x| { x.1; });