use std::cell::Cell;
thread_local! {
static LAST_WAS_HIT: Cell<bool> = const { Cell::new(false) };
}
pub fn last_was_hit() -> bool {
LAST_WAS_HIT.with(|cell| cell.get())
}
pub(crate) fn register_hit() {
LAST_WAS_HIT.with(|cell| cell.set(true))
}
pub(crate) fn register_miss() {
LAST_WAS_HIT.with(|cell| cell.set(false))
}