ferroui-controls 0.3.0

The controls of FerroUI: the application model, top levels, the control set and automation peers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::items_source::ItemsChangedEventArgs;

/// Collection helpers shared by the items controls.
pub struct CollectionUtils;

impl CollectionUtils {
    /// The arguments of a reset notification.
    pub const RESET_EVENT_ARGS: ItemsChangedEventArgs<'static> = ItemsChangedEventArgs::RESET;

    /// Inserts `count` copies of `item` at `index`.
    pub fn insert_many<T: Clone>(list: &mut Vec<T>, index: usize, item: T, count: usize) {
        list.splice(index..index, std::iter::repeat_n(item, count));
    }
}