Skip to content

Commit

Permalink
fixup! fix!(config): change precedence to CLI flags > env vars > conf…
Browse files Browse the repository at this point in the history
…ig file
  • Loading branch information
rami3l committed Jan 29, 2024
1 parent e7e369e commit e97f8a4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ ctrlc = { version = "3.4.2", features = ["termination"] }
dialoguer = { version = "0.11.0", features = ["fuzzy-select"] }
dirs-next = "2.0.0"
figment = { version = "0.10.14", features = ["env", "toml"] }
figment_file_provider_adapter = "0.1.1"
futures = { version = "0.3.30", default-features = false, features = ["std"] }
indoc = "2.0.4"
itertools = "0.12.0"
Expand Down
5 changes: 1 addition & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use figment::{
providers::{Env, Format, Toml},
Figment, Provider,
};
use figment_file_provider_adapter::FileAdapter;
use serde::{Deserialize, Serialize};
use tap::prelude::*;

Expand Down Expand Up @@ -94,9 +93,7 @@ impl Config {
pub fn file_provider() -> impl Provider {
Self::custom_path()
.or_else(Self::default_path)
.map_or_else(Figment::new, |f| {
Figment::from(FileAdapter::wrap(Toml::file(f)))
})
.map_or_else(Figment::new, |f| Figment::from(Toml::file(f)))
}

/// Returns the environment config [`Provider`].
Expand Down

0 comments on commit e97f8a4

Please sign in to comment.