Reorganize config file
This commit is contained in:
parent
380756df16
commit
1b8f3c9bc1
2 changed files with 10 additions and 5 deletions
|
|
@ -14,19 +14,24 @@ mod default {
|
|||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Config {
|
||||
pub struct Repo {
|
||||
#[serde(default = "default::repo_update_delay", with = "humantime_serde")]
|
||||
pub repo_update_delay: Duration,
|
||||
pub update_delay: Duration,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
impl Default for Repo {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
repo_update_delay: default::repo_update_delay(),
|
||||
update_delay: default::repo_update_delay(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize)]
|
||||
pub struct Config {
|
||||
pub repo: Repo,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn load(path: &Path) -> anyhow::Result<Self> {
|
||||
info!(path = %path.display(), "Loading config");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue