From ecce234e7b13fa0fbf847d49c63130422d73d8c0 Mon Sep 17 00:00:00 2001 From: Samir Talwar Date: Tue, 20 Feb 2024 16:37:22 +0100 Subject: [PATCH] Remove more constraints from `default_main`. Specifically, `Configuration` no longer needs to be serializable, as there is no configuration server which needs to serialize it. --- rust-connector-sdk/src/default_main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rust-connector-sdk/src/default_main.rs b/rust-connector-sdk/src/default_main.rs index 9291521c..f3fccd7a 100644 --- a/rust-connector-sdk/src/default_main.rs +++ b/rust-connector-sdk/src/default_main.rs @@ -17,7 +17,6 @@ use axum::{ use axum_extra::extract::WithRejection; use clap::{Parser, Subcommand}; use prometheus::Registry; -use serde::Serialize; use tower_http::{trace::TraceLayer, validate_request::ValidateRequestHeaderLayer}; use ndc_client::models::{ @@ -151,7 +150,7 @@ where /// - Logs are written to stdout pub async fn default_main() -> Result<(), Box> where - C::Configuration: Clone + Serialize, + C::Configuration: Clone, C::State: Clone, { let CliArgs { command } = CliArgs::parse(); @@ -168,8 +167,8 @@ async fn serve( serve_command: ServeCommand, ) -> Result<(), Box> where - C::Configuration: Serialize + Clone, - C::State: Sync + Send + Clone, + C::Configuration: Clone, + C::State: Clone, { init_tracing(&serve_command.service_name, &serve_command.otlp_endpoint) .expect("Unable to initialize tracing"); @@ -332,7 +331,7 @@ pub fn create_v2_router( service_token_secret: Option, ) -> Router where - C::Configuration: Clone + Serialize, + C::Configuration: Clone, C::State: Clone, { Router::new()