aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-28 12:52:07 -0800
committerAustin Hellyer <[email protected]>2016-12-28 12:52:07 -0800
commit6a887b25f2712d70c65fc85b5cfbd8b6d4b41260 (patch)
tree6a02950c20cafde26b91d60e893b3e8aedd1033d /src/model
parentUpdate current user presence in cache on set (diff)
downloadserenity-6a887b25f2712d70c65fc85b5cfbd8b6d4b41260.tar.xz
serenity-6a887b25f2712d70c65fc85b5cfbd8b6d4b41260.zip
Simplify Role's Ord impl
Diffstat (limited to 'src/model')
-rw-r--r--src/model/guild.rs14
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)
}
}
}