Function
search_load_config
(
name: &str,
search_paths: &[&str],
default_toml: &str,
leaf_config: Option<&str>,
nested: bool,
)
Source from the content-addressed store, hash-verified
| 44 | } |
| 45 | |
| 46 | fn search_load_config( |
| 47 | name: &str, |
| 48 | search_paths: &[&str], |
| 49 | default_toml: &str, |
| 50 | leaf_config: Option<&str>, |
| 51 | nested: bool, |
| 52 | ) -> Figment { |
| 53 | let mut figment = Figment::from(rocket::Config::default()) |
| 54 | .merge(Toml::string(default_toml).maybe_nested(nested)); |
| 55 | for path in search_paths { |
| 56 | figment = load_config_in_dir(name, path, nested, figment); |
| 57 | } |
| 58 | match leaf_config { |
| 59 | Some(path) => load_config_file(path, nested, figment), |
| 60 | None => figment, |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | pub fn load_config( |
| 65 | name: &str, |