heapless
heapless copied to clipboard
Make `Queue::split` `const`.
This allows constructing a producer-consumer pair directly in a static, e.g.
static PC: Mutex<RefCell<(Option<Producer<'static, (), 4>>, Option<Consumer<'static, (), 4>>)>> = {
static mut Q: Queue<(), 4> = Queue::new();
let (p, c) = unsafe { Q.split() };
Mutex::new(RefCell::new((Some(p), Some(c))))
};