The build_corridors
function introduces the sort_by
utility in Vec
. The call appears like this:
rooms.sort_by(|a,b| a.center().x.cmp(&b.center().x));
I believe it would help readers understanding why a
is used directly, whereas &b
is referenced.