diff --git a/src/bin/async_main.rs b/src/bin/async_main.rs index 8832e7a..2c0d8aa 100644 --- a/src/bin/async_main.rs +++ b/src/bin/async_main.rs @@ -17,13 +17,11 @@ use esp_wifi::{ EspWifiInitFor, }; -// When you are okay with using a nightly compiler it's better to use https://docs.rs/static_cell/2.1.0/static_cell/macro.make_static.html +// https://github.com/embassy-rs/static-cell/issues/16 macro_rules! mk_static { ($t:ty,$val:expr) => {{ static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new(); - #[deny(unused_attributes)] - let x = STATIC_CELL.uninit().write(($val)); - x + STATIC_CELL.init_with(|| $val) }}; }