Skip to content

Commit

Permalink
quick patchup for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRTTV committed Dec 4, 2024
1 parent bf2935d commit a0100b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/element_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ impl ElementAction {
Self::CopyRaw => {
use core::fmt::Write;

let mut buffer = key.map_or(String::new(), |x| if x.needs_escape() { format!("{x:?}") } else { x.into_string() } + ":");
let mut buffer = key.map_or(String::new(), |x| if crate::StrExt::needs_escape(x.as_str()) { format!("{x:?}") } else { x.into_string() } + ":");
if write!(&mut buffer, "{element}").is_err() { break 'm }
set_clipboard(buffer);
}
Self::CopyFormatted => {
use core::fmt::Write;

let mut buffer = key.map_or(String::new(), |x| if x.needs_escape() { format!("{x:?}") } else { x.into_string() } + ":");
let mut buffer = key.map_or(String::new(), |x| if crate::StrExt::needs_escape(x.as_str()) { format!("{x:?}") } else { x.into_string() } + ":");
if write!(&mut buffer, "{element:#?}").is_err() { break 'm }
set_clipboard(buffer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ impl NbtRegion {
#[inline]
#[cfg(target_arch = "wasm32")]
pub fn expand(&mut self) {
self.open = !self.is_empty();
self.set_open(!self.is_empty());
if !self.is_grid_layout() {
self.height = self.true_height;
for element in self.children_mut() {
Expand Down

0 comments on commit a0100b3

Please sign in to comment.