parse_kv_lines

Function parse_kv_lines 

Source
pub fn parse_kv_lines(input: &str) -> Result<ConfigMap, ParseKvError>
Expand description

Parse KEY=VALUE lines.

Rules:

  • Empty lines are ignored.
  • Lines starting with # are comments.
  • Keys are trimmed; values preserve surrounding whitespace after the =.
  • Later occurrences of the same key override earlier ones.

ยงErrors

Returns ParseKvError when an input line is not a comment/blank line and does not contain exactly one = separator, or when the key is empty after trimming.