Add initial unit test for channel list

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-08-24 13:12:02 -07:00
co-authored by Nathan Sobo
parent d9d52b8aa5
commit 8179f90589
5 changed files with 240 additions and 13 deletions
-5
View File
@@ -19,7 +19,6 @@ pub trait EnvelopedMessage: Clone + Sized + Send + Sync + 'static {
responding_to: Option<u32>,
original_sender_id: Option<u32>,
) -> Envelope;
fn matches_envelope(envelope: &Envelope) -> bool;
fn from_envelope(envelope: Envelope) -> Option<Self>;
}
@@ -90,10 +89,6 @@ macro_rules! messages {
}
}
fn matches_envelope(envelope: &Envelope) -> bool {
matches!(&envelope.payload, Some(envelope::Payload::$name(_)))
}
fn from_envelope(envelope: Envelope) -> Option<Self> {
if let Some(envelope::Payload::$name(msg)) = envelope.payload {
Some(msg)