Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Mar 27, 2024
1 parent e556eac commit e000d66
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/ott-balancer-protocol/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use uuid::Uuid;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
#[typeshare(serialized_as = "String")]
pub struct ClientId(Uuid);
#[derive(Debug, Clone, Eq, Ord, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, Serialize, Deserialize)]
#[typeshare(serialized_as = "String")]
pub struct RoomName(Arc<str>);
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
Expand Down Expand Up @@ -135,9 +135,15 @@ impl PartialEq for RoomName {

impl PartialOrd for RoomName {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

impl Ord for RoomName {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.0
.to_ascii_lowercase()
.partial_cmp(&other.0.to_ascii_lowercase())
.cmp(&other.0.to_ascii_lowercase())
}
}

Expand Down

0 comments on commit e000d66

Please sign in to comment.