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

fix: correct the feature name #275

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4"
version = "0.11.5"
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
2 changes: 1 addition & 1 deletion pilota/src/prost/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
extern crate alloc;

use alloc::{collections::BTreeMap, format, string::String, vec::Vec};
use core::{cmp::min, convert::TryFrom, mem, str, u32, usize};

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

View workflow job for this annotation

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

View workflow job for this annotation

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

use ::bytes::{Buf, BufMut, Bytes};

Expand Down Expand Up @@ -185,7 +185,7 @@
/// The context should be passed by value and can be freely cloned. When passing
/// to a function which is decoding a nested object, then use `enter_recursion`.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "no-recursion-limit", derive(Default))]

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

View workflow job for this annotation

GitHub Actions / clippy

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

warning: unexpected `cfg` condition value: `no-recursion-limit` --> pilota/src/prost/encoding.rs:188:12 | 188 | #[cfg_attr(feature = "no-recursion-limit", derive(Default))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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
pub struct DecodeContext {
/// How many times we can recurse in the current decode stack before we hit
/// the recursion limit.
Expand All @@ -193,11 +193,11 @@
/// The recursion limit is defined by `RECURSION_LIMIT` and cannot be
/// customized. The recursion limit can be ignored by building the Prost
/// crate with the `no-recursion-limit` feature.
#[cfg(not(feature = "no-recursion-limit"))]

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

View workflow job for this annotation

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
recurse_count: u32,
}

#[cfg(not(feature = "no-recursion-limit"))]

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

View workflow job for this annotation

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
impl Default for DecodeContext {
#[inline]
fn default() -> DecodeContext {
Expand All @@ -214,7 +214,7 @@
/// `DecodeContext` to be used at the next level of recursion. Continue
/// to use the old context
// at the previous level of recursion.
#[cfg(not(feature = "no-recursion-limit"))]

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

View workflow job for this annotation

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
#[inline]
pub(crate) fn enter_recursion(&self) -> DecodeContext {
DecodeContext {
Expand All @@ -222,7 +222,7 @@
}
}

#[cfg(feature = "no-recursion-limit")]

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

View workflow job for this annotation

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
#[inline]
pub(crate) fn enter_recursion(&self) -> DecodeContext {
DecodeContext {}
Expand All @@ -233,7 +233,7 @@
///
/// Returns `Ok<()>` if it is ok to continue recursing.
/// Returns `Err<DecodeError>` if the recursion limit has been reached.
#[cfg(not(feature = "no-recursion-limit"))]

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

View workflow job for this annotation

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
#[inline]
pub(crate) fn limit_reached(&self) -> Result<(), DecodeError> {
if self.recurse_count == 0 {
Expand All @@ -243,7 +243,7 @@
}
}

#[cfg(feature = "no-recursion-limit")]

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

View workflow job for this annotation

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
#[inline]
#[allow(clippy::unnecessary_wraps)] // needed in other features
pub(crate) fn limit_reached(&self) -> Result<(), DecodeError> {
Expand Down Expand Up @@ -952,7 +952,7 @@
// guard is used.
unsafe {
struct DropGuard<'a>(&'a mut Vec<u8>);
impl<'a> Drop for DropGuard<'a> {

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

View workflow job for this annotation

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<'_> { |
#[inline]
fn drop(&mut self) {
self.0.clear();
Expand Down Expand Up @@ -1579,10 +1579,10 @@
VL: Fn(u32, &V) -> usize,
{
for (key, val) in values.iter() {
let mut skip_key = key == &K::default();

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

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_key` is never read

warning: value assigned to `skip_key` is never read --> pilota/src/prost/encoding.rs:1582:25 | 1582 | let mut skip_key = key == &K::default(); | ^^^^^^^^ ... 1687 | 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 1582 in pilota/src/prost/encoding.rs

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_key` is never read

warning: value assigned to `skip_key` is never read --> pilota/src/prost/encoding.rs:1582:25 | 1582 | let mut skip_key = key == &K::default(); | ^^^^^^^^ ... 1683 | map!(AHashMap); | -------------- in this macro invocation | = help: maybe it is overwritten before being read? = note: `#[warn(unused_assignments)]` on by default = note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)
let mut skip_val = val == val_default;

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

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_val` is never read

warning: value assigned to `skip_val` is never read --> pilota/src/prost/encoding.rs:1583:25 | 1583 | let mut skip_val = val == val_default; | ^^^^^^^^ ... 1687 | 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 1583 in pilota/src/prost/encoding.rs

View workflow job for this annotation

GitHub Actions / clippy

value assigned to `skip_val` is never read

warning: value assigned to `skip_val` is never read --> pilota/src/prost/encoding.rs:1583:25 | 1583 | let mut skip_val = val == val_default; | ^^^^^^^^ ... 1683 | 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-zero-value")]
#[cfg(feature = "pb-encode-default-value")]
{
skip_key = false;
skip_val = false;
Expand Down
Loading