Skip to content

MenuBuilder::add_menu_items panics with "attempt to subtract with overflow" when passed an empty slice #50

Description

@RobertGauld
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
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions