summaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-05-16 10:55:24 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-05-16 10:55:24 -0400
commit2ab40a4911287c3ecdf56a70f3c716218e454d62 (patch)
tree44039d00ef98252e6f1d2a834cff22ced1b79785 /src/config/mod.rs
parent314245d36f3ca7da9ce329513938b452a2c90f1d (diff)
rework mimetype config
- users can now specify variables/classes that different extensions can "inherit" from, to prevent having to write the same mimetype multiple times ``` [extension] [extension.png] inherit = "some_predefined_class" app_list = [ { command = "more_entries" } ]
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 169e0ed..6cc4386 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -61,26 +61,3 @@ where
};
Some(config.flatten())
}
-
-// parses a config file into its appropriate format
-fn parse_config_file<T>(filename: &str) -> Option<T>
-where
- T: DeserializeOwned,
-{
- let file_path = search_directories(filename, &CONFIG_HIERARCHY)?;
- let file_contents = match fs::read_to_string(&file_path) {
- Ok(content) => content,
- Err(e) => {
- eprintln!("Error reading {} file: {}", filename, e);
- return None;
- }
- };
-
- match toml::from_str::<T>(&file_contents) {
- Ok(config) => Some(config),
- Err(e) => {
- eprintln!("Error parsing {} file: {}", filename, e);
- None
- }
- }
-}