easy_config 0.5.3

A language, parser, and lexer designed to make easy to read and write configuration files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::lexical_span::LexicalSpan;

pub trait OptionSpanCombine {
    fn combine(&mut self, other: LexicalSpan);
}

impl OptionSpanCombine for Option<LexicalSpan> {
    fn combine(&mut self, other: LexicalSpan) {
        if let Some(acc) = self {
            *acc = acc.combine(other)
        } else {
            *self = Some(other);
            return;
        }
    }
}