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,