leaderboard
A rust crate providing 2 functions for Vec useful in leaderboards:
vec.iter_ranked(): iterates on a sorted vec and group Equal elements together (ex aequos)vec.iter_sections(ranges): iterate over the vec on the domain defined by a vec of ranges
Example
Here's how the 2 functions can be used together to display top and bottom 3 ranks with ex aequos:
Output:
1. Item([150])
2. Item([142])
3. Item([138, 138])
...
7. Item([83])
8. Item([66])
9. Item([61, 61])