Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support encode zero value in protobuf to adjust to go proto2 #274

Merged
merged 3 commits into from
Oct 17, 2024

chore: add test for more type and use a better feature name

57f5131
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: support encode zero value in protobuf to adjust to go proto2 #274

chore: add test for more type and use a better feature name
57f5131
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Oct 17, 2024 in 0s

clippy

29 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 29
Note 0
Help 0

Versions

  • rustc 1.84.0-nightly (798fb83f7 2024-10-16)
  • cargo 1.84.0-nightly (8c30ce536 2024-10-15)
  • clippy 0.1.83 (798fb83 2024-10-16)

Annotations

Check warning on line 1 in examples/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `pilota::prost::Message as _`

warning: unused import: `pilota::prost::Message as _`
 --> examples/src/lib.rs:1:5
  |
1 | use pilota::prost::Message as _;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Check warning on line 333 in pilota-build/src/middle/context.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> pilota-build/src/middle/context.rs:324:5
    |
324 | /     pub(crate) fn build(
325 | |         self,
326 | |         services: Arc<[crate::IdlService]>,
327 | |         source_type: SourceType,
...   |
332 | |         split: bool,
333 | |     ) -> Context {
    | |________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
    = note: `#[warn(clippy::too_many_arguments)]` on by default

Check warning on line 26 in pilota-build/src/codegen/pkg_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary use of `first().is_some()` to check if slice is not empty

warning: unnecessary use of `first().is_some()` to check if slice is not empty
  --> pilota-build/src/codegen/pkg_tree.rs:26:21
   |
26 |         .filter(|p| p.first().is_some())
   |                     ^^^^^^^^^^^^^^^^^^^ help: replace this with: `!p.is_empty()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check

Check warning on line 17 in pilota-build/src/codegen/pkg_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary use of `first().is_some()` to check if slice is not empty

warning: unnecessary use of `first().is_some()` to check if slice is not empty
  --> pilota-build/src/codegen/pkg_tree.rs:17:31
   |
17 |     if pkgs.iter().filter(|p| p.first().is_some()).count() == 0 {
   |                               ^^^^^^^^^^^^^^^^^^^ help: replace this with: `!p.is_empty()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
   = note: `#[warn(clippy::unnecessary_first_then_check)]` on by default

Check warning on line 60 in pilota-build/src/ir/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

struct `ExceptionVariant` is never constructed

warning: struct `ExceptionVariant` is never constructed
  --> pilota-build/src/ir/mod.rs:60:12
   |
60 | pub struct ExceptionVariant {
   |            ^^^^^^^^^^^^^^^^
   |
   = note: `ExceptionVariant` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis

Check warning on line 14 in pilota-build/src/index.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `increment_by` is never used

warning: method `increment_by` is never used
  --> pilota-build/src/index.rs:14:8
   |
3  | pub trait Idx: Sized + Copy + 'static {
   |           --- method in this trait
...
14 |     fn increment_by(&mut self, amount: usize) {
   |        ^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 907 in pilota/src/thrift/binary_unsafe.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> pilota/src/thrift/binary_unsafe.rs:907:6
    |
907 | impl<'a> TInputProtocol for TBinaryUnsafeInputProtocol<'a> {
    |      ^^                                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
907 - impl<'a> TInputProtocol for TBinaryUnsafeInputProtocol<'a> {
907 + impl TInputProtocol for TBinaryUnsafeInputProtocol<'_> {
    |

Check warning on line 766 in pilota/src/thrift/binary_unsafe.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> pilota/src/thrift/binary_unsafe.rs:766:6
    |
766 | impl<'a> TLengthProtocol for TBinaryUnsafeInputProtocol<'a> {
    |      ^^                                                 ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
766 - impl<'a> TLengthProtocol for TBinaryUnsafeInputProtocol<'a> {
766 + impl TLengthProtocol for TBinaryUnsafeInputProtocol<'_> {
    |

Check warning on line 67 in pilota/src/prost/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

warning: usage of a legacy numeric method
  --> pilota/src/prost/mod.rs:67:24
   |
67 |     if length > usize::max_value() as u64 {
   |                        ^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
   |
67 |     if length > usize::MAX as u64 {
   |                        ~~~

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

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> pilota/src/prost/encoding.rs:955:18
    |
955 |             impl<'a> Drop for DropGuard<'a> {
    |                  ^^                     ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
955 -             impl<'a> Drop for DropGuard<'a> {
955 +             impl Drop for DropGuard<'_> {
    |

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

See this annotation in the file changed.

@github-actions github-actions / clippy

importing legacy numeric constants

warning: importing legacy numeric constants
 --> pilota/src/prost/encoding.rs:9:55
  |
9 | use core::{cmp::min, convert::TryFrom, mem, str, u32, usize};
  |                                                       ^^^^^
  |
  = help: remove this import
  = note: then `usize::<CONST>` will resolve to the respective associated constant
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

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

See this annotation in the file changed.

@github-actions github-actions / clippy

importing legacy numeric constants

warning: importing legacy numeric constants
 --> pilota/src/prost/encoding.rs:9:50
  |
9 | use core::{cmp::min, convert::TryFrom, mem, str, u32, usize};
  |                                                  ^^^
  |
  = help: remove this import
  = note: then `u32::<CONST>` will resolve to the respective associated constant
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

Check warning on line 4 in pilota/src/prost/message.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

importing legacy numeric constants

warning: importing legacy numeric constants
 --> pilota/src/prost/message.rs:4:24
  |
4 | use core::{fmt::Debug, usize};
  |                        ^^^^^
  |
  = help: remove this import
  = note: then `usize::<CONST>` will resolve to the respective associated constant
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
  = note: `#[warn(clippy::legacy_numeric_constants)]` on by default

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

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
    --> pilota/src/prost/encoding.rs:1583:21
     |
1583 |                 let mut skip_val = val == val_default;
     |                     ----^^^^^^^^
     |                     |
     |                     help: remove this `mut`
...
1687 |     map!(BTreeMap);
     |     -------------- in this macro invocation
     |
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
    --> pilota/src/prost/encoding.rs:1582:21
     |
1582 |                 let mut skip_key = key == &K::default();
     |                     ----^^^^^^^^
     |                     |
     |                     help: remove this `mut`
...
1687 |     map!(BTreeMap);
     |     -------------- in this macro invocation
     |
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
    --> pilota/src/prost/encoding.rs:1583:21
     |
1583 |                 let mut skip_val = val == val_default;
     |                     ----^^^^^^^^
     |                     |
     |                     help: remove this `mut`
...
1683 |     map!(AHashMap);
     |     -------------- in this macro invocation
     |
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
    --> pilota/src/prost/encoding.rs:1582:21
     |
1582 |                 let mut skip_key = key == &K::default();
     |                     ----^^^^^^^^
     |                     |
     |                     help: remove this `mut`
...
1683 |     map!(AHashMap);
     |     -------------- in this macro invocation
     |
     = note: `#[warn(unused_mut)]` on by default
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `pb-encode-zero-value`

warning: unexpected `cfg` condition value: `pb-encode-zero-value`
    --> pilota/src/prost/encoding.rs:1585:23
     |
1585 |                 #[cfg(feature = "pb-encode-zero-value")]
     |                       ^^^^^^^^^^----------------------
     |                                 |
     |                                 help: there is a expected value with a similar name: `"pb-encode-default-value"`
...
1687 |     map!(BTreeMap);
     |     -------------- in this macro invocation
     |
     = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
     = help: consider adding `pb-encode-zero-value` as a feature in `Cargo.toml`
     = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `pb-encode-zero-value`

warning: unexpected `cfg` condition value: `pb-encode-zero-value`
    --> pilota/src/prost/encoding.rs:1585:23
     |
1585 |                 #[cfg(feature = "pb-encode-zero-value")]
     |                       ^^^^^^^^^^----------------------
     |                                 |
     |                                 help: there is a expected value with a similar name: `"pb-encode-default-value"`
...
1683 |     map!(AHashMap);
     |     -------------- in this macro invocation
     |
     = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
     = help: consider adding `pb-encode-zero-value` as a feature in `Cargo.toml`
     = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
     = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:246:11
    |
246 |     #[cfg(feature = "no-recursion-limit")]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:236:15
    |
236 |     #[cfg(not(feature = "no-recursion-limit"))]
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:225:11
    |
225 |     #[cfg(feature = "no-recursion-limit")]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:217:15
    |
217 |     #[cfg(not(feature = "no-recursion-limit"))]
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:196:15
    |
196 |     #[cfg(not(feature = "no-recursion-limit"))]
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `no-recursion-limit`

warning: unexpected `cfg` condition value: `no-recursion-limit`
   --> pilota/src/prost/encoding.rs:200:11
    |
200 | #[cfg(not(feature = "no-recursion-limit"))]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `pb-encode-default-value` and `unstable`
    = help: consider adding `no-recursion-limit` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration