fn toggle_sel(siv: &mut Cursive, state: &mut AppState) {
    let p = siv
        .call_on_id("itemview", |v: &mut SelectView<PathBuf>| {
            v.selection().unwrap()
        })
        .unwrap();

    if state.sel.contains(p.as_ref()) {
        state.sel.remove(p.as_ref());
    } else {
        state.sel.insert(p.to_path_buf());
    }
}
/// UI callback to select/deselect item
UI callback to select/deselect item
UI callback to select / deselect item
fn toggle_sel(siv: &mut Cursive, state: &mut AppState) {
    let p = siv
        .call_on_id("itemview", |v: &mut SelectView<PathBuf>| {
            v.selection().unwrap()
        })
        .unwrap();
    if state.sel.contains(p.as_ref()) {
        state.sel.remove(p.as_ref());
    } else {
        state.sel.insert(p.to_path_buf());
    }
}
fn toggle_sel ( siv : & mut Cursive , state : & mut AppState ) { let p = siv . call_on_id ( " " , | v : & mut SelectView < PathBuf > | { v . selection ( ) . unwrap ( ) } ) . unwrap ( ) ; if state . sel . contains ( p . as_ref ( ) ) { state . sel . remove ( p . as_ref ( ) ) ; } else { state . sel . insert ( p . to_path_buf ( ) ) ; } }
UI callback to select/deselect item
UI callback to select / deselect item
siv
&mut Cursive
state
&mut AppState