Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum SomeEnum {
- A,
- B,
- }
- fn main() {
- let vector = vec!(("Foo", SomeEnum::A), ("Bar", SomeEnum::B),("Foo", SomeEnum::B), ("Foo", SomeEnum::A));
- // I would here like to be able to sort/sort_by leaving this
- // it is sorted by tuple.0 and tuple.1 first looking at tuple.0 then tuple.1
- // [("Bar", SomeEnum::B), ("Foo", SomeEnum::A), ("Foo", SomeEnum::B), ("Foo", SomeEnum::B)]
- // Then I would like to dedup the list leaving this:
- // [("Bar", SomeEnum::B), ("Foo", SomeEnum::A), ("Foo", SomeEnum::B)]
- println!("{:?}", vector)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement