From 08476057e25c47ad705a1a602cd49d65ff0e7966 Mon Sep 17 00:00:00 2001 From: "wangjie.wjdew" Date: Fri, 18 Oct 2024 22:14:17 +0800 Subject: [PATCH 1/2] fix: calculate the default value len when use the default encode feature --- pilota/src/prost/encoding.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pilota/src/prost/encoding.rs b/pilota/src/prost/encoding.rs index 393b509f..8266178c 100644 --- a/pilota/src/prost/encoding.rs +++ b/pilota/src/prost/encoding.rs @@ -1658,10 +1658,10 @@ macro_rules! map { KL: Fn(u32, &K) -> usize, VL: Fn(u32, &V) -> usize, { - let mut skip_default_value = false; + let mut skip_default_value = true; #[cfg(feature = "pb-encode-default-value")] { - skip_default_value = true; + skip_default_value = false; } key_len(tag) * values.len() From 00089d83d866bb2a9adea1763ae38ba3f9be0f30 Mon Sep 17 00:00:00 2001 From: "wangjie.wjdew" Date: Fri, 18 Oct 2024 22:17:58 +0800 Subject: [PATCH 2/2] chore: update version --- Cargo.lock | 2 +- pilota/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 339475b7..c5b64369 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -821,7 +821,7 @@ dependencies = [ [[package]] name = "pilota" -version = "0.11.6" +version = "0.11.7" dependencies = [ "ahash", "anyhow", diff --git a/pilota/Cargo.toml b/pilota/Cargo.toml index 37430e6d..33a73341 100644 --- a/pilota/Cargo.toml +++ b/pilota/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pilota" -version = "0.11.6" +version = "0.11.7" edition = "2021" description = "Pilota is a thrift and protobuf implementation in pure rust with high performance and extensibility." documentation = "https://docs.rs/pilota"