Rust sort_unstable_by with more complex closure unexpectedly shrunk binary
By tracyspacy · 2026-07-02 · 3 points · 0 comments
Thing I stumbled upon: I added boolean argument and if statement inside sort_unstable_by closure: ``` //from |&a, &b| compare(a, b) //to |&a, &b| if is_reverse { compare(b, a) } else { compare(a, b) } ``` I expected binary to grow slightly, but actually it be…
Open the full discussion on BetterNews