whitespace_conf

Function parse

Source
pub fn parse<'a>(input: &'a str) -> HashMap<&'a str, &'a str>
Expand description

Parses configuration files which are key-value pairs delimited by whitespace.

Examples found in repository?
examples/login_defs.rs (line 6)
3
4
5
6
7
8
9
10
fn main() {
    let string = fs::read_to_string("/etc/login.defs").unwrap();

    let defs = whitespace_conf::parse(&string);

    println!("UID_MIN = {:?}", defs.get("UID_MIN"));
    println!("UID_MAX = {:?}", defs.get("UID_MAX"));
}