From 5e39458b94ed0c9e0d7f500d5a1b0509930e9b38 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 27 Jun 2022 14:46:59 -0400 Subject: [PATCH] chore: Fix clippy warnings --- prost-build/src/code_generator.rs | 2 +- src/encoding.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prost-build/src/code_generator.rs b/prost-build/src/code_generator.rs index e733ddfe3..36bce11f5 100644 --- a/prost-build/src/code_generator.rs +++ b/prost-build/src/code_generator.rs @@ -1057,7 +1057,7 @@ struct EnumVariantMapping<'a> { fn build_enum_value_mappings<'a>( generated_enum_name: &str, do_strip_enum_prefix: bool, - enum_values: &'a Vec, + enum_values: &'a [EnumValueDescriptorProto], ) -> Vec> { let mut numbers = HashSet::new(); let mut generated_names = HashMap::new(); diff --git a/src/encoding.rs b/src/encoding.rs index 250b34e90..7674581d5 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -1444,7 +1444,7 @@ mod test { T: Debug + Default + PartialEq + Borrow, B: ?Sized, { - prop_assume!(MIN_TAG <= tag && tag <= MAX_TAG); + prop_assume!((MIN_TAG..=MAX_TAG).contains(&tag)); let expected_len = encoded_len(tag, value.borrow()); @@ -1533,7 +1533,7 @@ mod test { M: FnMut(WireType, &mut T, &mut Bytes, DecodeContext) -> Result<(), DecodeError>, L: FnOnce(u32, &B) -> usize, { - prop_assume!(MIN_TAG <= tag && tag <= MAX_TAG); + prop_assume!((MIN_TAG..=MAX_TAG).contains(&tag)); let expected_len = encoded_len(tag, value.borrow());