Skip to content

Commit

Permalink
feat: Enhance Server::new to accept impl Into<Option<T>> for ergonomics
Browse files Browse the repository at this point in the history
Replicated-from: #100
Includes-commit: 15cffed
  • Loading branch information
gengteng authored and eaufavor committed Mar 22, 2024
1 parent ab86012 commit 558371c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b1c09703606d32b02f24d2e77d82936ba95e8064
ff2f3fb1c3c2b52d92fd5ff3b76b6f4d25488fb2
3 changes: 2 additions & 1 deletion pingora-core/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 558371c

Please sign in to comment.