MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / load_config_file

Function load_config_file

load_config/src/lib.rs:25–33  ·  view source on GitHub ↗
(path: &str, nested: bool, figment: Figment)

Source from the content-addressed store, hash-verified

23}
24
25fn 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
35fn load_config_in_dir(name: &str, path: &str, nested: bool, mut figment: Figment) -> Figment {
36 for ext in ["toml", "json"] {

Callers 6

load_config_in_dirFunction · 0.85
search_load_configFunction · 0.85

Calls 2

fileClass · 0.85
maybe_nestedMethod · 0.80