add more From

This commit is contained in:
shenjack 2023-08-05 11:28:39 +08:00
parent 18d1f3f566
commit 8e05b2cd69
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -71,6 +71,16 @@ impl NbtItem {
}
}
impl From<NbtValue> for NbtItem {
#[inline]
fn from(value: NbtValue) -> Self { Self::Value(value) }
}
impl From<NbtList> for NbtItem {
#[inline]
fn from(value: NbtList) -> Self { Self::Array(value) }
}
impl From<Vec<NbtItem>> for NbtList {
#[inline]
fn from(value: Vec<NbtItem>) -> Self { Self::List(Rc::new(RefCell::new(value))) }