Skip to content

Commit

Permalink
fine
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRTTV committed Apr 11, 2024
1 parent d372d4e commit 5f767f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions src/elements/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5f767f7

Please sign in to comment.