mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
feat: Enhance Server::new to accept impl Into<Option<T>> for ergonomics
Replicated-from: https://github.com/cloudflare/pingora/pull/100
Includes-commit: 15cffed202
This commit is contained in:
parent
ab86012c66
commit
558371c190
2 changed files with 3 additions and 2 deletions
2
.bleep
2
.bleep
|
@ -1 +1 @@
|
|||
b1c09703606d32b02f24d2e77d82936ba95e8064
|
||||
ff2f3fb1c3c2b52d92fd5ff3b76b6f4d25488fb2
|
|
@ -175,7 +175,8 @@ impl Server {
|
|||
///
|
||||
/// Command line options can either be passed by parsing the command line arguments via
|
||||
/// `Opt::from_args()`, or be generated by other means.
|
||||
pub fn new(opt: Option<Opt>) -> Result<Server> {
|
||||
pub fn new(opt: impl Into<Option<Opt>>) -> Result<Server> {
|
||||
let opt = opt.into();
|
||||
let (tx, rx) = watch::channel(false);
|
||||
|
||||
let conf = if let Some(opt) = opt.as_ref() {
|
||||
|
|
Loading…
Reference in a new issue