(path: &str, nested: bool, figment: Figment)
| 23 | } |
| 24 | |
| 25 | fn load_config_file(path: &str, nested: bool, figment: Figment) -> Figment { |
| 26 | if path.ends_with(".json") { |
| 27 | return figment.merge(Json::file(path).maybe_nested(nested)); |
| 28 | } |
| 29 | if path.ends_with(".toml") { |
| 30 | return figment.merge(Toml::file(path).maybe_nested(nested)); |
| 31 | } |
| 32 | figment.merge(Json::file(path).maybe_nested(nested)) |
| 33 | } |
| 34 | |
| 35 | fn load_config_in_dir(name: &str, path: &str, nested: bool, mut figment: Figment) -> Figment { |
| 36 | for ext in ["toml", "json"] { |