From f7aeb60bfa9fda6e9fdc78a8fd8f9c4845b4d4fb Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 5 Aug 2023 11:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E4=B8=AA=E5=A5=BD=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/read.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/read.rs b/src/read.rs index aead3e9..c59a1b7 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1,8 +1,6 @@ use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader}; -use std::cell::RefCell; -use std::convert::{From, Into}; +use std::convert::From; use std::io::{Cursor, Read}; -use std::rc::Rc; /// 输出类型标识符 /// 类型标识符 @@ -110,7 +108,7 @@ pub mod read { [0x07] => { // ByteArray for _ in 0..len { - vec.push(NbtItem::Array(NbtList::from(from_bool_array(value)))); + vec.push(NbtItem::from(from_bool_array(value))); } } [0x08] => { @@ -124,26 +122,26 @@ pub mod read { // 要命 (虽说没 Compound 那么麻烦) // 直接递归就行 for _ in 0..len { - vec.push(NbtItem::Array(NbtList::from(read_nbt_list(value)))); + vec.push(NbtItem::from(read_nbt_list(value))); } } [0x0A] => { // Compound // 他甚至不告诉你有多少个元素,要命 for _ in 0..len { - vec.push(NbtItem::Array(NbtList::from(from_compound(value)))); + vec.push(NbtItem::from(from_compound(value))); } } [0x0B] => { // IntArray for _ in 0..len { - vec.push(NbtItem::Array(NbtList::from(from_i32_array(value)))); + vec.push(NbtItem::from(from_i32_array(value))); } } [0x0C] => { // LongArray for _ in 0..len { - vec.push(NbtItem::Array(NbtList::from(from_i64_array(value)))); + vec.push(NbtItem::from(from_i64_array(value))); } } _ => {