Fixes #261 - Better Default implementation for Opt

---
Empty commit to trigger checks again
---
Another empty commit to trigger checks

Includes-commit: 0e9d853e05
Includes-commit: 1237b26493
Includes-commit: 6fdaf38b63
Replicated-from: https://github.com/cloudflare/pingora/pull/272
This commit is contained in:
Wladimir Palant 2024-06-08 20:35:40 +00:00 committed by Edward Wang
parent ace9d4f135
commit 86e6cd2912
2 changed files with 2 additions and 11 deletions

2
.bleep
View file

@ -1 +1 @@
e91e896243a80fdbac73b5663224459a6e8d1db5
dad4171e22fa0f38c7dc19247c36f4004d1245de

View file

@ -119,7 +119,7 @@ impl Default for ServerConf {
/// Command-line options
///
/// Call `Opt::from_args()` to build this object from the process's command line arguments.
#[derive(Parser, Debug)]
#[derive(Parser, Debug, Default)]
#[clap(name = "basic", long_about = None)]
pub struct Opt {
/// Whether this server should try to upgrade from a running old server
@ -163,15 +163,6 @@ pub struct Opt {
pub conf: Option<String>,
}
/// Create the default instance of Opt based on the current command-line args.
/// This is equivalent to running `Opt::parse` but does not require the
/// caller to have included the `clap::Parser`
impl Default for Opt {
fn default() -> Self {
Opt::parse()
}
}
impl ServerConf {
// Does not has to be async until we want runtime reload
pub fn load_from_yaml<P>(path: P) -> Result<Self>