whitespace-conf

Crates.iowhitespace-conf
lib.rswhitespace-conf
version1.0.0
sourcesrc
created_at2021-06-27 23:58:38.648703
updated_at2021-06-27 23:58:38.648703
descriptionKey-value configuration file delimited with whitespaces
homepagehttps://github.com/pop-os/whitespace-conf
repositoryhttps://github.com/pop-os/whitespace-conf
max_upload_size
id415555
size15,526
Jeremy Soller (jackpot51)

documentation

README

whitespace-conf

Rust library for parsing configuration files which are key-value pairs delimited by whitespace. Lines that start with # are ignored.

use std::fs;

fn main() {
    let string = fs::read_to_string("/etc/login.defs").unwrap();

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

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

cargo fmt