Skip to main content

parse_list

Function parse_list 

Source
pub fn parse_list<B: AsRef<str>>(value: B) -> Vec<Text> 
Expand description

Parse a configuration value as a list of comma/space separated strings. It is ported from mercurial.config.parselist.

The function never complains about syntax and always returns some result.

Example:

use configmodel::convert::parse_list;

assert_eq!(
    parse_list("this,is \"a small\" ,test"),
    vec![
        "this".to_string(),
        "is".to_string(),
        "a small".to_string(),
        "test".to_string()
    ]
);