2 releases

0.1.1 Feb 15, 2023
0.1.0 Jun 29, 2021

#1842 in Parser implementations

MIT license

17KB
354 lines

props-rs

props-rs is a parser library which can parse Java .properties file definitions. This library is a fork and improvement of an older, unmaintained (and now, non-public) version of the dotproperties library on crates.io.

It was updated to use more modern Rust features as well as use the latest nom parsing library.

Issues/Discussion

Bugs and other problems are handled through GitHub issues. Please file tickets there. Broader discussions or questions may be handled through GitHub Discussions


lib.rs:

props-rs is a library which parses a .properties file format as specified by the Oracle documentation

use props_rs::*;

let properties = br"
key1=value1
key2=value2
key3=value3
";
let parsed = parse(properties).unwrap();
let properties = to_map(parsed);

assert_eq!("value1", properties.get("key1").unwrap());
assert_eq!("value2", properties.get("key2").unwrap());
assert_eq!("value3", properties.get("key3").unwrap());

Dependencies

~1MB
~19K SLoC