diff --git a/src/main.rs b/src/main.rs index c911c30..9f58f2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -194,6 +194,7 @@ pub struct Config { pub output: OutputConfig, /// Download settings #[clap(flatten)] + #[serde(default)] pub http: HttpConfig, /// Specify configuration values using the provided TOML file, instead of /// via command line flags. The values in the config file will override @@ -274,6 +275,16 @@ impl std::fmt::Debug for TargetRegistryConfig { } } +impl Default for HttpConfig { + fn default() -> Self { + Self { + user_agent: default_user_agent(), + requests_per_second: default_requests_per_second(), + max_concurrent_requests: default_max_concurrent_requests(), + } + } +} + impl std::fmt::Debug for HttpConfig { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("Config")