虽然但是,不应该套娃的(
This commit is contained in:
parent
f7aeb60bfa
commit
28d674d4f5
10
src/data.rs
10
src/data.rs
@ -83,27 +83,27 @@ impl From<NbtList> for NbtItem {
|
|||||||
|
|
||||||
impl From<Vec<NbtItem>> for NbtItem {
|
impl From<Vec<NbtItem>> for NbtItem {
|
||||||
#[inline]
|
#[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 {
|
impl From<HashMap<Arc<str>, NbtItem>> for NbtItem {
|
||||||
#[inline]
|
#[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 {
|
impl From<Vec<bool>> for NbtItem {
|
||||||
#[inline]
|
#[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 {
|
impl From<Vec<i32>> for NbtItem {
|
||||||
#[inline]
|
#[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 {
|
impl From<Vec<i64>> for NbtItem {
|
||||||
#[inline]
|
#[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 {
|
impl From<Vec<NbtItem>> for NbtList {
|
||||||
|
@ -12,8 +12,8 @@ use std::io::{Cursor, Read};
|
|||||||
/// (0x0C) Vec<i64>
|
/// (0x0C) Vec<i64>
|
||||||
pub mod read {
|
pub mod read {
|
||||||
use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader};
|
use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader};
|
||||||
use std::io::Read;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::io::Read;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// 直接读取长度和值 不带名称
|
/// 直接读取长度和值 不带名称
|
||||||
|
Loading…
Reference in New Issue
Block a user