Skip to content

Commit

Permalink
fix wasm build
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Jun 28, 2024
1 parent f0ae009 commit 7fc1fb8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/unavi-scripting/src/host/wired_input/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ use super::wired::input::{
types::InputEvent,
};

pub struct SpatialHandler;
#[derive(Default)]
pub struct SpatialHandler {}

impl HostSpatialHandler for StoreState {
fn new(&mut self, node: Resource<Node>) -> wasm_bridge::Result<Resource<SpatialHandler>> {
let handler = SpatialHandler;
let res = self.table.push_child(handler, &node)?;
let handler = SpatialHandler::default();
let res = self.table.push(handler)?;
let rep = res.rep();

let node = self.table.get_mut(&node)?;
Expand All @@ -28,7 +29,8 @@ impl HostSpatialHandler for StoreState {
Ok(None)
}

fn drop(&mut self, _rep: Resource<SpatialHandler>) -> wasm_bridge::Result<()> {
fn drop(&mut self, rep: Resource<SpatialHandler>) -> wasm_bridge::Result<()> {
self.table.delete(rep)?;
Ok(())
}
}

0 comments on commit 7fc1fb8

Please sign in to comment.