Skip to content

Commit

Permalink
Remove more constraints from default_main. (#105)
Browse files Browse the repository at this point in the history
Specifically, `Configuration` no longer needs to be serializable, as
there is no configuration server which needs to serialize it.
  • Loading branch information
SamirTalwar authored Feb 20, 2024
1 parent 42b3cfa commit 09edbd5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rust-connector-sdk/src/default_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -151,7 +150,7 @@ where
/// - Logs are written to stdout
pub async fn default_main<C: Connector + 'static>() -> Result<(), Box<dyn Error + Send + Sync>>
where
C::Configuration: Clone + Serialize,
C::Configuration: Clone,
C::State: Clone,
{
let CliArgs { command } = CliArgs::parse();
Expand All @@ -168,8 +167,8 @@ async fn serve<C: Connector + 'static>(
serve_command: ServeCommand,
) -> Result<(), Box<dyn Error + Send + Sync>>
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");
Expand Down Expand Up @@ -332,7 +331,7 @@ pub fn create_v2_router<C: Connector + 'static>(
service_token_secret: Option<String>,
) -> Router
where
C::Configuration: Clone + Serialize,
C::Configuration: Clone,
C::State: Clone,
{
Router::new()
Expand Down

0 comments on commit 09edbd5

Please sign in to comment.