chore: cleanup unused config properties

This commit is contained in:
seth 2024-01-27 23:03:34 -05:00
parent 2acb319821
commit 72e171b960
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
6 changed files with 23 additions and 152 deletions

View file

@ -1,16 +1,9 @@
use color_eyre::eyre::Result;
mod discord;
mod github;
pub use discord::*;
pub use github::*;
use discord::DiscordConfig;
#[derive(Debug, Clone)]
pub struct Config {
pub discord: DiscordConfig,
pub github: GithubConfig,
pub http_port: u16,
pub redis_url: String,
}
@ -18,22 +11,18 @@ impl Default for Config {
fn default() -> Self {
Self {
discord: DiscordConfig::default(),
github: GithubConfig::default(),
http_port: 3000,
redis_url: "redis://localhost:6379".to_string(),
}
}
}
impl Config {
pub fn new_from_env() -> Result<Self> {
let discord = DiscordConfig::new_from_env()?;
let github = GithubConfig::new_from_env()?;
pub fn new_from_env() -> Self {
let discord = DiscordConfig::new_from_env();
Ok(Self {
Self {
discord,
github,
..Default::default()
})
}
}
}