From dcee738c9a7e8e07d8183b6bde19748572a18925 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 5 Aug 2023 11:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9A=E8=87=B3=E5=A5=97=E5=A8=83=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/data.rs b/src/data.rs index da55605..3c1d1ec 100644 --- a/src/data.rs +++ b/src/data.rs @@ -81,6 +81,31 @@ impl From for NbtItem { fn from(value: NbtList) -> Self { Self::Array(value) } } +impl From> for NbtItem { + #[inline] + fn from(value: Vec) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) } +} + +impl From, NbtItem>> for NbtItem { + #[inline] + fn from(value: HashMap, NbtItem>) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) } +} + +impl From> for NbtItem { + #[inline] + fn from(value: Vec) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) } +} + +impl From> for NbtItem { + #[inline] + fn from(value: Vec) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) } +} + +impl From> for NbtItem { + #[inline] + fn from(value: Vec) -> Self { Self::Array(NbtList::from(Rc::new(RefCell::new(value)))) } +} + impl From> for NbtList { #[inline] fn from(value: Vec) -> Self { Self::List(Rc::new(RefCell::new(value))) }