虽然但是,不应该套娃的(

This commit is contained in:
shenjack 2023-08-05 11:36:47 +08:00
parent f7aeb60bfa
commit 28d674d4f5
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 6 additions and 6 deletions

View File

@ -83,27 +83,27 @@ impl From<NbtList> for NbtItem {
impl From<Vec<NbtItem>> for NbtItem {
#[inline]
fn from(value: Vec<NbtItem>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
fn from(value: Vec<NbtItem>) -> Self { Self::Array(NbtList::from(value)) }
}
impl From<HashMap<Arc<str>, NbtItem>> for NbtItem {
#[inline]
fn from(value: HashMap<Arc<str>, NbtItem>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
fn from(value: HashMap<Arc<str>, NbtItem>) -> Self { Self::Array(NbtList::from(value)) }
}
impl From<Vec<bool>> for NbtItem {
#[inline]
fn from(value: Vec<bool>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
fn from(value: Vec<bool>) -> Self { Self::Array(NbtList::from(value)) }
}
impl From<Vec<i32>> for NbtItem {
#[inline]
fn from(value: Vec<i32>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
fn from(value: Vec<i32>) -> Self { Self::Array(NbtList::from(value)) }
}
impl From<Vec<i64>> for NbtItem {
#[inline]
fn from(value: Vec<i64>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
fn from(value: Vec<i64>) -> Self { Self::Array(NbtList::from(value)) }
}
impl From<Vec<NbtItem>> for NbtList {

View File

@ -12,8 +12,8 @@ use std::io::{Cursor, Read};
/// (0x0C) Vec<i64>
pub mod read {
use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader};
use std::io::Read;
use std::collections::HashMap;
use std::io::Read;
use std::sync::Arc;
/// 直接读取长度和值 不带名称