diff --git a/Cargo.toml b/Cargo.toml index 3fa27a26..dd7a6636 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mosaic-tile" -version = "0.3.0" +version = "0.3.1" authors = ["Brooks J Rady "] edition = "2018" description = "A small client-side library for writing mosaic plugins (tiles)" diff --git a/src/lib.rs b/src/lib.rs index 9d373a02..5279520b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,11 +12,8 @@ pub trait MosaicTile { #[macro_export] macro_rules! register_tile { ($t:ty) => { - use mosaic_tile::*; - - use std::cell::RefCell; thread_local! { - static STATE: RefCell<$t> = RefCell::new(Default::default()); + static STATE: std::cell::RefCell<$t> = std::cell::RefCell::new(Default::default()); } fn main() { @@ -35,14 +32,14 @@ macro_rules! register_tile { #[no_mangle] pub fn handle_key() { STATE.with(|state| { - state.borrow_mut().handle_key(get_key()); + state.borrow_mut().handle_key($crate::get_key()); }); } #[no_mangle] pub fn handle_global_key() { STATE.with(|state| { - state.borrow_mut().handle_global_key(get_key()); + state.borrow_mut().handle_global_key($crate::get_key()); }); } };