fix msg type equality bug
This commit is contained in:
parent
7b78274a52
commit
935347ffcf
|
@ -32,7 +32,7 @@ pub struct SsbMessageValue {
|
|||
}
|
||||
|
||||
/// Message content types.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum SsbMessageContentType {
|
||||
About,
|
||||
|
@ -70,12 +70,10 @@ impl SsbMessageValue {
|
|||
|
||||
/// Helper function which returns `true` if this message is of the given type,
|
||||
/// and `false` if the type does not match or is not found.
|
||||
pub fn is_message_type(&self, _message_type: SsbMessageContentType) -> bool {
|
||||
pub fn is_message_type(&self, message_type: SsbMessageContentType) -> bool {
|
||||
let self_message_type = self.get_message_type();
|
||||
match self_message_type {
|
||||
Ok(mtype) => {
|
||||
matches!(mtype, _message_type)
|
||||
}
|
||||
Ok(mtype) => mtype == message_type,
|
||||
Err(_err) => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue