1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! An example of getting an editorconfig property

use editor_config::parser::EditorConfig;

fn main() {
    let editorconfig_path = "tests/test_data/.editorconfig";

    // File must be provided
    let editorconfig = EditorConfig::from_file(editorconfig_path).unwrap();

    if let Some(indent_style) = editorconfig.get_property("*", "end_of_line") {
        println!("EOL: {}", indent_style);
    } else {
        println!("End of line not specified.");
    }
}