aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-01-11 16:05:55 +0000
committerBrooks J Rady <b.j.rady@gmail.com>2021-01-11 16:05:55 +0000
commit1275a9e73a1098fec7c984f017c07d5349781ac3 (patch)
tree3a6491072f53ce73195c281b3204ea900fbf2e00 /src
parentAdd a new host function (diff)
downloadsl0ppij-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.rs9
1 files changed, 3 insertions, 6 deletions
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());
});
}
};