mirror of
https://codeberg.org/demostf/parser.git
synced 2026-11-30 10:40:50 +01:00
make Message::encode write the message type instead of requiring to do so manually
This commit is contained in:
parent
9b0e19a7e7
commit
2bb0a60171
4 changed files with 16 additions and 8 deletions
|
|
@ -255,6 +255,7 @@ impl<'a> Message<'a> {
|
|||
#[cfg(feature = "write")]
|
||||
impl Encode for Message<'_> {
|
||||
fn encode(&self, stream: &mut BitWriteStream<LittleEndian>, state: &ParserState) -> Result<()> {
|
||||
self.get_message_type().write(stream)?;
|
||||
match self {
|
||||
Message::Empty => Ok(()),
|
||||
Message::Disconnect(reason) => reason.encode(stream, state),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue