From 34058b25283947137216964462a1370d08010066 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 1 May 2022 23:45:28 -0500 Subject: [PATCH] Remove some resolved todo comments --- azalea-core/src/slot.rs | 4 +--- azalea-crypto/src/lib.rs | 1 - azalea-protocol/src/mc_buf/write.rs | 2 -- .../src/packets/login/clientbound_game_profile_packet.rs | 9 ++------- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/azalea-core/src/slot.rs b/azalea-core/src/slot.rs index 2e581586..5e42f558 100644 --- a/azalea-core/src/slot.rs +++ b/azalea-core/src/slot.rs @@ -1,4 +1,4 @@ -// TODO: have an azalea-inventory crate and put this there +// TODO: have an azalea-inventory or azalea-container crate and put this there #[derive(Debug, Clone)] pub enum Slot { @@ -9,8 +9,6 @@ pub enum Slot { #[derive(Debug, Clone)] pub struct SlotData { pub id: i32, - // TODO: is this really a u8? is it a i8? is it a varint? - // wiki.vg says it's a "byte" pub count: u8, pub nbt: azalea_nbt::Tag, } diff --git a/azalea-crypto/src/lib.rs b/azalea-crypto/src/lib.rs index dc2620cc..f47b91fe 100644 --- a/azalea-crypto/src/lib.rs +++ b/azalea-crypto/src/lib.rs @@ -59,7 +59,6 @@ pub fn encrypt(public_key: &[u8], nonce: &[u8]) -> Result }) } -// TODO: update the aes and cfb8 crates pub type Aes128CfbEnc = cfb8::Encryptor; pub type Aes128CfbDec = cfb8::Decryptor; diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs index 34bcafeb..c125bf0b 100755 --- a/azalea-protocol/src/mc_buf/write.rs +++ b/azalea-protocol/src/mc_buf/write.rs @@ -168,8 +168,6 @@ impl McBufWritable for UnsizedByteArray { } } -// TODO: use specialization when that gets stabilized into rust -// to optimize for Vec byte arrays impl McBufWritable for Vec { default fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_list(self, |buf, i| T::write_into(i, buf)) diff --git a/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs b/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs index dd077ced..dd11f7f7 100755 --- a/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs @@ -1,6 +1,7 @@ use std::io::{Read, Write}; use super::LoginPacket; +use crate::mc_buf::McBufReadable; use crate::mc_buf::{Readable, Writable}; use azalea_auth::game_profile::GameProfile; use azalea_core::serializable_uuid::SerializableUuid; @@ -26,13 +27,7 @@ impl ClientboundGameProfilePacket { } pub fn read(buf: &mut impl Read) -> Result { - // TODO: we have a thing to read from the uuid now - let uuid = Uuid::from_int_array([ - buf.read_int()? as u32, - buf.read_int()? as u32, - buf.read_int()? as u32, - buf.read_int()? as u32, - ]); + let uuid = Uuid::read_into(buf)?; let name = buf.read_utf_with_len(16)?; Ok(ClientboundGameProfilePacket { game_profile: GameProfile::new(uuid, name),