From 6372269d5d2d12858c1ad1c3f23f2da7e2fa1da1 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sun, 8 Dec 2024 04:06:46 +0530 Subject: [PATCH] fix: serde compilation intricacies --- src/cli.rs | 6 +++--- src/handlers/http/kinesis.rs | 2 +- src/handlers/http/middleware.rs | 2 +- src/option.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index d510cd5af..afaafc912 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -591,11 +591,11 @@ impl FromArgMatches for Cli { .get_one::(Self::ROW_GROUP_SIZE) .cloned() .expect("default for row_group size"); - self.parquet_compression = serde_json::from_str( + self.parquet_compression = serde_json::from_str(&format!( + "{:?}", m.get_one::(Self::PARQUET_COMPRESSION_ALGO) .expect("default for compression algo") - .as_str(), - ) + )) .expect("unexpected compression algo"); let openid_client_id = m.get_one::(Self::OPENID_CLIENT_ID).cloned(); diff --git a/src/handlers/http/kinesis.rs b/src/handlers/http/kinesis.rs index 778f78ef4..084f686cd 100644 --- a/src/handlers/http/kinesis.rs +++ b/src/handlers/http/kinesis.rs @@ -24,7 +24,7 @@ use std::collections::BTreeMap; use std::str; #[derive(Serialize, Deserialize, Debug)] -#[serde(rename = "camelCase")] +#[serde(rename_all = "camelCase")] struct Message { records: Vec, request_id: String, diff --git a/src/handlers/http/middleware.rs b/src/handlers/http/middleware.rs index aacc39399..79e7f6e15 100644 --- a/src/handlers/http/middleware.rs +++ b/src/handlers/http/middleware.rs @@ -44,7 +44,7 @@ use crate::{ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] -#[serde(rename = "camelCase")] +#[serde(rename_all = "camelCase")] struct Message { common_attributes: CommonAttributes, } diff --git a/src/option.rs b/src/option.rs index 385a45aa6..46bd05084 100644 --- a/src/option.rs +++ b/src/option.rs @@ -254,7 +254,7 @@ pub enum Mode { } #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Deserialize)] -#[serde(rename = "lowercase")] +#[serde(rename_all = "lowercase")] pub enum Compression { Uncompressed, Snappy,