diff options
| author | n1c00o <git.n1c00o@gmail.com> | 2021-10-16 22:18:25 +0200 |
|---|---|---|
| committer | n1c00o <git.n1c00o@gmail.com> | 2021-10-16 22:18:25 +0200 |
| commit | 03908129599260587fe7b9fd8254d28ad50b8714 (patch) | |
| tree | c72ac6aa70c64f0cc0893519d7a585f9eab200d5 /common/rust/src/config.rs | |
| parent | 031df88b8f978a0809dc8a32f795ffebda416d20 (diff) | |
Fix some warnings
Diffstat (limited to 'common/rust/src/config.rs')
| -rw-r--r-- | common/rust/src/config.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/common/rust/src/config.rs b/common/rust/src/config.rs index c158a21..bd12350 100644 --- a/common/rust/src/config.rs +++ b/common/rust/src/config.rs @@ -2,8 +2,7 @@ use std::env; use config::{Config, ConfigError, Environment, File}; use log::info; -use serde::{Deserialize}; - +use serde::Deserialize; #[derive(Debug, Deserialize, Clone)] #[serde(bound(deserialize = "T: Deserialize<'de> + std::default::Default + Clone"))] @@ -14,7 +13,10 @@ pub struct Settings<T> { pub nats: crate::nats::NatsConfiguration, } -impl<T> Settings<T> where T: Deserialize<'static> + std::default::Default + Clone { +impl<T> Settings<T> +where + T: Deserialize<'static> + std::default::Default + Clone, +{ pub fn new(service_name: &str) -> Result<Settings<T>, ConfigError> { let mut default = Config::default(); // this file my be shared with all the components @@ -30,7 +32,7 @@ impl<T> Settings<T> where T: Deserialize<'static> + std::default::Default + Clon let mut config: Settings<T> = default.clone().try_into().unwrap(); // try to load the config - config.config = default.get::<T>(&service_name).unwrap(); + config.config = default.get::<T>(service_name).unwrap(); pretty_env_logger::init(); // start the monitoring system if needed |
