How to sort a vector of a custom struct in Rust
When implementing tags for Texted2, I had a list of tags being:
let tags: Vec<(&am...
For further actions, you may consider blocking this person and/or reporting abuse
That's a nice simpler alternative, indeed :)
I find it less readable, however.
Why is that? Also, if you are concerned it could be misunderstood, put the lambda in a separate named function called
reverse_orderor something.Now this is on the preference realm. After living many, many years in the low latency world, where things are not super readable, I like explicit things when possible, such as the block:
And, of course, that's my personal preference :) Both are ok - and I agree with you that the function name is better using a descriptive name.
And thanks for the feedback!
Wouldn't it be simpler to
count_b.cmp(count_a)to change the ordering?