Skip to content

Commit 52d60a9

Browse files
authored
Fix Ord impl for Role (#3377)
Discord does position DESC, id ASC
1 parent 7f71e69 commit 52d60a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/model/guild/role.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ impl Eq for Role {}
157157

158158
impl Ord for Role {
159159
fn cmp(&self, other: &Role) -> Ordering {
160+
// Discord does position DESC, id ASC so:
160161
if self.position == other.position {
161-
self.id.cmp(&other.id)
162+
other.id.cmp(&self.id)
162163
} else {
163164
self.position.cmp(&other.position)
164165
}

0 commit comments

Comments
 (0)