kv-parser

Crates.iokv-parser
lib.rskv-parser
version0.1.0
sourcesrc
created_at2021-09-30 21:24:19.316659
updated_at2021-09-30 21:24:19.316659
descriptionA simple parser of key-value-files as hash maps
homepage
repositoryhttps://gitlab.com/porky11/kv-parser
max_upload_size
id458908
size2,670
Fabio Krapohl (porky11)

documentation

README

Parses simple text format into a HashMap.

The keys and values are both strings and are separated by whitespace. The value is allowed to contain whitespaces.

Example

Key-Value-File:

key1 value1
key2 value2
key3 value3

The result would be a HashMap like this:

let mut map = HashMap::new();
map.insert("key1".to_string(), "value1".to_string());
map.insert("key2".to_string(), "value2".to_string());
map.insert("key3".to_string(), "value3".to_string());
assert_eq!(map, file_to_key_value_map(path));
Commit count: 3

cargo fmt