embedded-menu
embedded-menu copied to clipboard
MenuBuilder::add_menu_items panics with "attempt to subtract with overflow" when passed an empty slice
let mut items = Vec::new();
let mut menu = Menu::with_style(title, style.clone())
.add_menu_items(items.as_mut_slice())
.build();
Results in:
3.156 ERROR panicked at /home/robert/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/embedded-menu-0.6.1/src/interaction/mod.rs:56:38:
attempt to subtract with overflow
``
Thanks for finding this. I'm not able to actively work on embedded-menu, but if you're willing to get your hands dirty, I'd be happy to merge and release a fix.