diff options
Diffstat (limited to 'azalea-nbt/src')
| -rw-r--r-- | azalea-nbt/src/decode.rs | 3 | ||||
| -rw-r--r-- | azalea-nbt/src/encode.rs | 2 | ||||
| -rw-r--r-- | azalea-nbt/src/tag.rs | 24 |
3 files changed, 13 insertions, 16 deletions
diff --git a/azalea-nbt/src/decode.rs b/azalea-nbt/src/decode.rs index f3fbae54..a0a4ba8c 100644 --- a/azalea-nbt/src/decode.rs +++ b/azalea-nbt/src/decode.rs @@ -6,7 +6,6 @@ use std::{collections::HashMap, io::Read}; impl Tag { fn read_known(stream: &mut impl Read, id: u8) -> Result<Tag, Error> { - println!("read_known: id={}", id); let tag = match id { // Signifies the end of a TAG_Compound. It is only ever used inside // a TAG_Compound, and is not named despite being in a TAG_Compound @@ -67,9 +66,7 @@ impl Tag { 10 => { let mut map = HashMap::new(); loop { - println!("compound loop"); let tag_id = stream.read_u8().unwrap_or(0); - println!("compound loop tag_id={}", tag_id); if tag_id == 0 { break; } diff --git a/azalea-nbt/src/encode.rs b/azalea-nbt/src/encode.rs index d787e15f..2347bbf3 100644 --- a/azalea-nbt/src/encode.rs +++ b/azalea-nbt/src/encode.rs @@ -42,7 +42,7 @@ impl Tag { } Tag::List(value) => { // we just get the type from the first item, or default the type to END - let type_id = value.first().and_then(|f| Some(f.id())).unwrap_or(0); + let type_id = value.first().map(|f| f.id()).unwrap_or(0); writer.write_u8(type_id).map_err(|_| Error::WriteError)?; writer .write_i32::<BE>(value.len() as i32) diff --git a/azalea-nbt/src/tag.rs b/azalea-nbt/src/tag.rs index 7c59ea87..53ec6680 100644 --- a/azalea-nbt/src/tag.rs +++ b/azalea-nbt/src/tag.rs @@ -21,18 +21,18 @@ impl Tag { pub fn id(&self) -> u8 { match self { Tag::End => 0, - Tag::Byte(value) => 1, - Tag::Short(value) => 2, - Tag::Int(value) => 3, - Tag::Long(value) => 4, - Tag::Float(value) => 5, - Tag::Double(value) => 6, - Tag::ByteArray(value) => 7, - Tag::String(value) => 8, - Tag::List(value) => 9, - Tag::Compound(value) => 10, - Tag::IntArray(value) => 11, - Tag::LongArray(value) => 12, + Tag::Byte(_) => 1, + Tag::Short(_) => 2, + Tag::Int(_) => 3, + Tag::Long(_) => 4, + Tag::Float(_) => 5, + Tag::Double(_) => 6, + Tag::ByteArray(_) => 7, + Tag::String(_) => 8, + Tag::List(_) => 9, + Tag::Compound(_) => 10, + Tag::IntArray(_) => 11, + Tag::LongArray(_) => 12, } } } |
