Skip to content

Commit

Permalink
impl eq for message
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge committed Sep 10, 2023
1 parent e9cfab2 commit 7ed3a10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ impl From<&str> for Message {
}
}

impl PartialEq<Message> for String {
fn eq(&self, other: &Message) -> bool {
self == &other.message
}
}
impl PartialEq<Message> for u8 {
fn eq(&self, other: &Message) -> bool {
self == &other.code
}
}

pub trait IntoRuleMessage {
fn into_message(self) -> Message;
}
Expand Down

0 comments on commit 7ed3a10

Please sign in to comment.