Skip to main content

split_choice_list

Function split_choice_list 

Source
pub(crate) fn split_choice_list(raw: &str) -> Vec<String>
Expand description

Split a comma-separated choices list (as given to choices(param = "a, b, c")) into individual trimmed entries. Surrounding double-quotes are tolerated so users can spell the list either way: "a, b" or "\"a\", \"b\"".

Shared by the inherent-impl (miniextendr_impl.rs) and trait-impl (miniextendr_impl_trait/vtable.rs) choices(...) attribute parsers so the two independently-maintained parsers can’t drift on quoting/whitespace rules.