Replaces the handling for adding multiple items to the Select, FuzzySelect, MultiSelect, and Sort they currently take a slice containing any number of values that can be converted into String through ToString, this change replaces taking a slice with instead taking anything that implement IntoIterator where the item is ToString.
This allows the items function to take any collection of values rather than only allowing slices, thus making something like the following possible:
struct MyItem {
name: String,
// .. other struct items
}
let collection: Vec<MyItem> = vec![ /* Some list of items */ ];
let item_names = collection
.iter()
.map(|item| item.name.as_str());
Select::new()
.items(item_names);
Changes
Make items, items_checked (and similar functions) accept an iterator instead of a slice
Description
Replaces the handling for adding multiple items to the
Select
,FuzzySelect
,MultiSelect
, andSort
they currently take a slice containing any number of values that can be converted intoString
throughToString
, this change replaces taking a slice with instead taking anything that implementIntoIterator
where the item isToString
.This allows the items function to take any collection of values rather than only allowing slices, thus making something like the following possible:
Changes
items
,items_checked
(and similar functions) accept an iterator instead of a slice