drop figment

Just deserialize directly via the `toml` crate.
This commit is contained in:
Charles Hall 2024-06-06 22:07:32 -07:00
parent 003c0a4928
commit 2b0bc140cf
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 18 additions and 97 deletions

View file

@ -16,10 +16,6 @@ use axum::{
use axum_server::{
bind, bind_rustls, tls_rustls::RustlsConfig, Handle as ServerHandle,
};
use figment::{
providers::{Format, Toml},
Figment,
};
use http::{
header::{self, HeaderName},
Method, StatusCode, Uri,
@ -110,10 +106,12 @@ async fn try_main() -> Result<(), error::Main> {
let args = args::parse();
// Initialize config
let raw_config = Figment::new().merge(Toml::file(&args.config));
let config = raw_config.extract::<Config>()?;
let config = toml::from_str(
&tokio::fs::read_to_string(&args.config)
.await
.map_err(Error::ConfigRead)?,
)
.map_err(Error::ConfigParse)?;
let _guard = observability::init(&config);