fn ui_mark_itemview(siv: &mut Cursive, state: &mut AppState) {
    siv.call_on_id("itemview", |v: &mut SelectView<PathBuf>| {
        for i in 0..v.len() {
            let (s, p) = v.get_item_mut(i).unwrap();
            let item = state.items_all.get(p).unwrap();

            *s = format!(
                "{} {}",
                if state.sel.contains(p) { "[X]" } else { "[ ]" },
                item.name
            )
            .into();
        }
    });
}
/// Generate/update checkbox states in items view
///
/// Our "checkboxes" are just prefixes to the string displayed.
Generate/update checkbox states in items view
Our "checkboxes" are just prefixes to the string displayed.
Generate / update checkbox states in items view Our " checkboxes " are just prefixes to the string displayed .
fn ui_mark_itemview(siv: &mut Cursive, state: &mut AppState) {
    siv.call_on_id("itemview", |v: &mut SelectView<PathBuf>| {
        for i in 0..v.len() {
            let (s, p) = v.get_item_mut(i).unwrap();
            let item = state.items_all.get(p).unwrap();
            *s = format!(
                "{} {}",
                if state.sel.contains(p) { "[X]" } else { "[ ]" },
                item.name
            )
            .into();
        }
    });
}
fn ui_mark_itemview ( siv : & mut Cursive , state : & mut AppState ) { siv . call_on_id ( " " , | v : & mut SelectView < PathBuf > | { for i in 0 .. v . len ( ) { let ( s , p ) = v . get_item_mut ( i ) . unwrap ( ) ; let item = state . items_all . get ( p ) . unwrap ( ) ; * s = format ! ( " " if state sel contains ( p ) { " " } else { " " } item name ) . into ( ) ; } } ) ; }
Generate/update checkbox states in items view
Our "checkboxes" are just prefixes to the string displayed.
Generate / update checkbox states in items view Our " checkboxes " are just prefixes to the string displayed .
siv
&mut Cursive
state
&mut AppState