diff options
| author | Austin Hellyer <[email protected]> | 2016-12-28 12:52:07 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-28 12:52:07 -0800 |
| commit | 6a887b25f2712d70c65fc85b5cfbd8b6d4b41260 (patch) | |
| tree | 6a02950c20cafde26b91d60e893b3e8aedd1033d /src/model | |
| parent | Update current user presence in cache on set (diff) | |
| download | serenity-6a887b25f2712d70c65fc85b5cfbd8b6d4b41260.tar.xz serenity-6a887b25f2712d70c65fc85b5cfbd8b6d4b41260.zip | |
Simplify Role's Ord impl
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/guild.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/model/guild.rs b/src/model/guild.rs index 3a45b3a..aabbb06 100644 --- a/src/model/guild.rs +++ b/src/model/guild.rs @@ -1150,18 +1150,10 @@ impl Eq for Role {} impl Ord for Role { fn cmp(&self, other: &Role) -> Ordering { - if self.position > other.position { - Ordering::Greater - } else if self.position == other.position { - if self.id > other.id { - Ordering::Greater - } else if self.id == other.id { - Ordering::Equal - } else { - Ordering::Less - } + if self.position == other.position { + self.id.cmp(&other.id) } else { - Ordering::Less + self.position.cmp(&other.position) } } } |