get_property/
get_property.rs

1//! An example of getting an editorconfig property
2
3use editor_config::parser::EditorConfig;
4
5fn main() {
6    let editorconfig_path = "tests/test_data/.editorconfig";
7
8    // File must be provided
9    let editorconfig = EditorConfig::from_file(editorconfig_path).unwrap();
10
11    if let Some(indent_style) = editorconfig.get_property("*", "end_of_line") {
12        println!("EOL: {}", indent_style);
13    } else {
14        println!("End of line not specified.");
15    }
16}