From 5f767f724ba437a6f98d0335d7adf5aa12d337d4 Mon Sep 17 00:00:00 2001 From: RTTV Date: Thu, 11 Apr 2024 14:28:59 -0400 Subject: [PATCH] fine --- Cargo.toml | 8 ++++---- src/elements/element.rs | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee244b2..b559ff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,12 @@ keywords = ["nbt", "window", "unsafe", "editor", "tree"] categories = ["graphics", "rendering", "text-editors", "parser-implementations"] # Wasm Only -#[lib] -#crate-type = ["cdylib", "rlib"] -#path = "src/main.rs" +[lib] +crate-type = ["cdylib", "rlib"] +path = "src/main.rs" # Windows Only -[package.metadata.winres] +#[package.metadata.winres] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/elements/element.rs b/src/elements/element.rs index dc46424..8498101 100644 --- a/src/elements/element.rs +++ b/src/elements/element.rs @@ -1079,22 +1079,26 @@ impl NbtElement { #[cfg(not(target_arch = "wasm32"))] ElementAction::OpenInTxt, ], + #[cfg(not(target_arch = "wasm32"))] NbtList::ID => { const FULL: [ElementAction; 4] = [ ElementAction::CopyRaw, ElementAction::CopyFormatted, - #[cfg(not(target_arch = "wasm32"))] ElementAction::OpenInTxt, - #[cfg(not(target_arch = "wasm32"))] ElementAction::OpenArrayInHex ]; let id = self.as_list_unchecked().element; - if matches!(id, NbtByte::ID | NbtShort::ID | NbtInt::ID | NbtLong::ID) || cfg!(target_arch = "wasm32") { + if matches!(id, NbtByte::ID | NbtShort::ID | NbtInt::ID | NbtLong::ID) { &FULL } else { &FULL[..FULL.len() - 1] } }, + #[cfg(target_arch = "wasm32")] + NbtList::ID => &[ + ElementAction::CopyRaw, + ElementAction::CopyFormatted, + ], NbtCompound::ID => &[ ElementAction::CopyRaw, ElementAction::CopyFormatted,