From dedcd0de8f017a00645b31cfdc1819a4e8da0850 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 1 May 2022 23:35:30 -0500 Subject: impl Write instead of Vec for consistency --- azalea-protocol/src/packets/login/clientbound_hello_packet.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'azalea-protocol/src/packets/login/clientbound_hello_packet.rs') diff --git a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs index 06f346c2..f7de4c21 100755 --- a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs @@ -1,4 +1,7 @@ -use std::{hash::Hash, io::Read}; +use std::{ + hash::Hash, + io::{Read, Write}, +}; use super::LoginPacket; use crate::mc_buf::Readable; @@ -15,11 +18,11 @@ impl ClientboundHelloPacket { LoginPacket::ClientboundHelloPacket(self) } - pub fn write(&self, _buf: &mut Vec) -> Result<(), std::io::Error> { + pub fn write(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> { panic!("ClientboundHelloPacket::write not implemented") } - pub fn read(buf: &mut impl Read) -> Result { + pub fn read(buf: &mut impl Read) -> Result { let server_id = buf.read_utf_with_len(20)?; let public_key = buf.read_byte_array()?; let nonce = buf.read_byte_array()?; -- cgit v1.2.3