I have ks: Vec<(Vec<u64>, U)>
that I would like to sort by the tuple's 1st element's sum. How do I do that?
I tried this
ks.sort_by_key(|k| k.0.iter().sum());
But this gives me the error message
type annotations needed
cannot infer type for type parameter `K` declared on the associated function `sort_by_key` (rustc E0282)
: consider specifying the type argument in the method call: `::<S>`