1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use std::collections::HashMap;

use preparser::Syntax;
use validators::Filter;
use {Options};

impl Options {
    /// Create options with all defaults values
    pub fn new() -> Options {
        Options {
            syntax: Syntax::Plain,
            new_line_at_eof: None,
            curly: false,
            square: false,
            round: false,
            default_filter: Filter::NoFilter,
            filters: HashMap::new(),
        }
    }
    /// Enables `oneline` syntax by default
    ///
    /// This is equivalent as `## syntax: oneline` in a template. But
    /// template author can still override the syntax.
    pub fn syntax_oneline(&mut self) -> &mut Self {
        self.syntax = Syntax::Oneline;
        self
    }
    /// Enables `indent` syntax by default
    ///
    /// This is equivalent as `## syntax: indent` in a template. But
    /// template author can still override the syntax.
    pub fn syntax_indent(&mut self) -> &mut Self {
        self.syntax = Syntax::Indent;
        self
    }
}