diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-11 16:05:55 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-11 16:05:55 +0000 |
| commit | 1275a9e73a1098fec7c984f017c07d5349781ac3 (patch) | |
| tree | 3a6491072f53ce73195c281b3204ea900fbf2e00 /src | |
| parent | Add a new host function (diff) | |
| download | sl0ppij-1275a9e73a1098fec7c984f017c07d5349781ac3.tar.gz sl0ppij-1275a9e73a1098fec7c984f017c07d5349781ac3.tar.xz sl0ppij-1275a9e73a1098fec7c984f017c07d5349781ac3.zip | |
No more glob imports in the register_tile! macro
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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()); }); } }; |
