From 0030e7b2f41166374d8d5a0dd477fa35558ab3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Wed, 30 Aug 2023 15:42:53 +0200 Subject: [PATCH] chore: remove unnecessary panel Option from ServeOptions This is effectively a boolean, remove the Option that would involve two ways of disabling the panel. --- crates/server/src/lib.rs | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/server/src/lib.rs b/crates/server/src/lib.rs index 36bc1b26..5aaae936 100644 --- a/crates/server/src/lib.rs +++ b/crates/server/src/lib.rs @@ -53,7 +53,7 @@ pub struct ServeOptions { pub base_routes: Routes, pub hostname: String, pub port: u16, - pub panel: Option, + pub panel: Panel, pub stderr: Option, pub cors_origins: Option>, } @@ -116,7 +116,7 @@ pub async fn serve(serve_options: ServeOptions) -> Result { .app_data(Data::clone(&data_connectors)); // Configure panel - if serve_options.panel == Some(Panel::Enabled) { + if serve_options.panel == Panel::Enabled { app = app.configure(config_panel_handlers); app = app.configure(config_manage_api_handlers); } diff --git a/src/main.rs b/src/main.rs index 8d3aa240..a6ec8759 100644 --- a/src/main.rs +++ b/src/main.rs @@ -200,7 +200,7 @@ async fn main() -> std::io::Result<()> { base_routes: routes, hostname: args.hostname.clone(), port: args.port, - panel: Some(args.enable_panel.into()), + panel: args.enable_panel.into(), stderr: None, cors_origins: args.cors, })