Skip to content

Instantly share code, notes, and snippets.

Created Aug 18, 2020
What would you like to do?
A small example of grouping-by crate.
// This returns for each year, the contract with the most days.
|contract|, // Key of HashMap
|contract1, contract2| contract1.days.cmp(&contract2.days), // Comparator to get the max
) // Returns `HashMap<i32, Contract>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment