aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWladimir Palant <[email protected]>2024-06-08 20:35:40 +0000
committerEdward Wang <[email protected]>2024-06-28 12:34:25 -0700
commit86e6cd29121b8ae62e343ad73cd5cc7717b91126 (patch)
tree44fc01cf8dc2e6b974576e044578ae0eb9285528
parentace9d4f135c3e3805db36cbed9c03c5c4f14ca52 (diff)
downloadpingora-86e6cd29121b8ae62e343ad73cd5cc7717b91126.tar.gz
pingora-86e6cd29121b8ae62e343ad73cd5cc7717b91126.zip
Fixes #261 - Better `Default` implementation for `Opt`
--- Empty commit to trigger checks again --- Another empty commit to trigger checks Includes-commit: 0e9d853e05c1ea59bfaceac48a2769d523f0e818 Includes-commit: 1237b26493d0f9980441551be83cac62d7dc1cb8 Includes-commit: 6fdaf38b6359a17ba739097b6dff4250c6393ba5 Replicated-from: https://github.com/cloudflare/pingora/pull/272
-rw-r--r--.bleep2
-rw-r--r--pingora-core/src/server/configuration/mod.rs11
2 files changed, 2 insertions, 11 deletions
diff --git a/.bleep b/.bleep
index 0a99fe9..e85542a 100644
--- a/.bleep
+++ b/.bleep
@@ -1 +1 @@
-e91e896243a80fdbac73b5663224459a6e8d1db5 \ No newline at end of file
+dad4171e22fa0f38c7dc19247c36f4004d1245de \ No newline at end of file
diff --git a/pingora-core/src/server/configuration/mod.rs b/pingora-core/src/server/configuration/mod.rs
index c118c84..0bd3222 100644
--- a/pingora-core/src/server/configuration/mod.rs
+++ b/pingora-core/src/server/configuration/mod.rs
@@ -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>