From 0305675bc8855234db8905f7d706a5c741db3aff Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 8 Nov 2024 11:47:46 -0500 Subject: [PATCH] cargo fmt --- src/config.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/config.rs b/src/config.rs index 2c3c854..e401e84 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,9 +1,6 @@ use figment::{ providers::{Env, Format, Yaml}, - Figment, - Metadata, - Provider, - Profile, + Figment, Metadata, Profile, Provider, }; use serde::{Deserialize, Serialize}; use std::net::SocketAddr; @@ -85,23 +82,17 @@ impl Default for Config { impl Config { fn figment() -> Figment { - let figment = Figment::from(Config::default()) - .merge(Env::prefixed("TASKWORKER_")); - figment + Figment::from(Config::default()).merge(Env::prefixed("TASKWORKER_")) } /// Build a Config instance from defaults and Env vars pub fn from_env() -> Result { - let config = Config::figment().extract(); - config + Config::figment().extract() } /// Build a Config instance from default, env vars and a file. pub fn from_file(path: &Path) -> Result { - let config = Config::figment() - .merge(Yaml::file(path)) - .extract(); - config + Config::figment().merge(Yaml::file(path)).extract() } }