# How to sort enum variants?

**URL:** <https://users.rust-lang.org/t/how-to-sort-enum-variants/52291>\
**Category:** help\
**Created:** [December 3, 2020, 10:24pm UTC](https://users.rust-lang.org/t/how-to-sort-enum-variants/52291 "2020-12-03T22:24:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fyl2xp1](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/fyl2xp1/32/2159_2.png) [@fyl2xp1](https://users.rust-lang.org/u/fyl2xp1)\
**Post date:** [December 3, 2020, 10:46pm UTC](https://users.rust-lang.org/t/how-to-sort-enum-variants/52291/4 "2020-12-03T22:46:42Z")

</div>

They're taken into account as second criterion.

> [@ArifRoktim](#):
>
> `assert!(E::First(24) < E::First(50))`

This will pass but shouldn't. (if the inner value was ignored they should be equal)

---

_[View the full topic](https://users.rust-lang.org/t/how-to-sort-enum-variants/52291)._
