甚至套娃 from
This commit is contained in:
parent
8d7d802c45
commit
dcee738c9a
25
src/data.rs
25
src/data.rs
@ -81,6 +81,31 @@ impl From<NbtList> for NbtItem {
|
|||||||
fn from(value: NbtList) -> Self { Self::Array(value) }
|
fn from(value: NbtList) -> Self { Self::Array(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Vec<NbtItem>> for NbtItem {
|
||||||
|
#[inline]
|
||||||
|
fn from(value: Vec<NbtItem>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(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)))) }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Vec<bool>> for NbtItem {
|
||||||
|
#[inline]
|
||||||
|
fn from(value: Vec<bool>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Vec<i32>> for NbtItem {
|
||||||
|
#[inline]
|
||||||
|
fn from(value: Vec<i32>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Vec<i64>> for NbtItem {
|
||||||
|
#[inline]
|
||||||
|
fn from(value: Vec<i64>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) }
|
||||||
|
}
|
||||||
|
|
||||||
impl From<Vec<NbtItem>> for NbtList {
|
impl From<Vec<NbtItem>> for NbtList {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn from(value: Vec<NbtItem>) -> Self { Self::List(Rc::new(RefCell::new(value))) }
|
fn from(value: Vec<NbtItem>) -> Self { Self::List(Rc::new(RefCell::new(value))) }
|
||||||
|
Loading…
Reference in New Issue
Block a user