Skip to content

Commit

Permalink
chore: remove unnecessary panel Option from ServeOptions
Browse files Browse the repository at this point in the history
This is effectively a boolean, remove the Option that would involve
two ways of disabling the panel.
  • Loading branch information
ereslibre committed Aug 30, 2023
1 parent 6c1a273 commit 0030e7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct ServeOptions {
pub base_routes: Routes,
pub hostname: String,
pub port: u16,
pub panel: Option<Panel>,
pub panel: Panel,
pub stderr: Option<PathBuf>,
pub cors_origins: Option<Vec<String>>,
}
Expand Down Expand Up @@ -116,7 +116,7 @@ pub async fn serve(serve_options: ServeOptions) -> Result<Server> {
.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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 0030e7b

Please sign in to comment.