1 2 3 4 5 6 7 8 9 10 11 12 13
static mut OPEN: fn() = || panic!("must called ui::init"); static mut CLOSE: fn() = || panic!("must called ui::init"); pub fn init(open: fn(), close: fn()) { unsafe { OPEN = open; CLOSE = close; } } pub fn open() {} pub fn close() {}