Skip to content

Commit

Permalink
fix: calculate default value len when use pb encode default value fea…
Browse files Browse the repository at this point in the history
…ture (#277)

* fix: calculate the default value len when use the default encode feature

* chore: update version
  • Loading branch information
Ggiggle authored Oct 18, 2024
1 parent 69f4396 commit 5a06bf8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pilota/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pilota/src/prost/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 1661 in pilota/src/prost/encoding.rs

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_default_value` is never read

warning: value assigned to `skip_default_value` is never read --> pilota/src/prost/encoding.rs:1661:21 | 1661 | let mut skip_default_value = true; | ^^^^^^^^^^^^^^^^^^ ... 1693 | map!(BTreeMap); | -------------- in this macro invocation | = help: maybe it is overwritten before being read? = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 1661 in pilota/src/prost/encoding.rs

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_default_value` is never read

warning: value assigned to `skip_default_value` is never read --> pilota/src/prost/encoding.rs:1661:21 | 1661 | let mut skip_default_value = true; | ^^^^^^^^^^^^^^^^^^ ... 1689 | map!(AHashMap); | -------------- in this macro invocation | = help: maybe it is overwritten before being read? = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)
#[cfg(feature = "pb-encode-default-value")]
{
skip_default_value = true;
skip_default_value = false;
}

key_len(tag) * values.len()
Expand Down

0 comments on commit 5a06bf8

Please sign in to comment.