Skip to content

Commit

Permalink
Fix CI (#136)
Browse files Browse the repository at this point in the history
* Fix lints

* Fix lint

* Correct MSRV in README to match value in changelog, CI and Cargo.toml

* Update dependencies

* Fix build in 1.83.0

Workaround for rust-lang/rust#133824
  • Loading branch information
andrewhickman authored Dec 3, 2024
1 parent 8fd210d commit db85a69
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 221 deletions.
424 changes: 244 additions & 180 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ prost_reflect_build::Builder::new()

## Minimum Supported Rust Version

Rust **1.64** or higher.
Rust **1.70** or higher.

The minimum supported Rust version may be changed in the future, but it will be
done with a minor version bump.
Expand Down
2 changes: 1 addition & 1 deletion README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A protobuf library extending [`prost`](https://crates.io/crates/prost) with refl

## Minimum Supported Rust Version

Rust **1.64** or higher.
Rust **1.70** or higher.

The minimum supported Rust version may be changed in the future, but it will be
done with a minor version bump.
Expand Down
Binary file added prost-reflect/doc/file_descriptor_set.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions prost-reflect/src/descriptor/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ impl DescriptorPool {
files: &'a [FileDescriptorInner],
}

impl<'a> fmt::Debug for FileDescriptorSet<'a> {
impl fmt::Debug for FileDescriptorSet<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("FileDescriptorSet").finish_non_exhaustive()
}
}

impl<'a> Message for FileDescriptorSet<'a> {
impl Message for FileDescriptorSet<'_> {
fn encode_raw(&self, buf: &mut impl BufMut)
where
Self: Sized,
Expand Down
4 changes: 2 additions & 2 deletions prost-reflect/src/descriptor/build/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct NameVisitor<'a> {
errors: Vec<DescriptorErrorKind>,
}

impl<'a> Visitor for NameVisitor<'a> {
impl Visitor for NameVisitor<'_> {
fn visit_file(&mut self, path: &[i32], index: FileIndex, file: &FileDescriptorProto) {
debug_assert_eq!(to_index(self.pool.files.len()), index);

Expand Down Expand Up @@ -326,7 +326,7 @@ impl<'a> Visitor for NameVisitor<'a> {
}
}

impl<'a> NameVisitor<'a> {
impl NameVisitor<'_> {
fn add_name(
&mut self,
file: FileIndex,
Expand Down
4 changes: 2 additions & 2 deletions prost-reflect/src/descriptor/build/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct OptionsVisitor<'a> {
locations: Vec<(FileIndex, Box<[i32]>, Box<[i32]>)>,
}

impl<'a> Visitor for OptionsVisitor<'a> {
impl Visitor for OptionsVisitor<'_> {
fn visit_file(&mut self, path: &[i32], index: FileIndex, file: &FileDescriptorProto) {
if let Some(options) = &file.options {
let path = join_path(path, &[tag::file::OPTIONS]);
Expand Down Expand Up @@ -296,7 +296,7 @@ impl<'a> Visitor for OptionsVisitor<'a> {
}
}

impl<'a> OptionsVisitor<'a> {
impl OptionsVisitor<'_> {
fn resolve_options<T>(
&mut self,
desc_name: &str,
Expand Down
4 changes: 2 additions & 2 deletions prost-reflect/src/descriptor/build/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct ResolveVisitor<'a> {
errors: Vec<DescriptorErrorKind>,
}

impl<'a> Visitor for ResolveVisitor<'a> {
impl Visitor for ResolveVisitor<'_> {
fn visit_file(&mut self, path: &[i32], index: FileIndex, file: &FileDescriptorProto) {
let mut transitive_dependencies = HashSet::with_capacity(file.dependency.len() + 1);
transitive_dependencies.insert(index);
Expand Down Expand Up @@ -414,7 +414,7 @@ impl<'a> Visitor for ResolveVisitor<'a> {
}
}

impl<'a> ResolveVisitor<'a> {
impl ResolveVisitor<'_> {
fn resolve_public_dependencies(&self, dependencies: &mut HashSet<FileIndex>, index: FileIndex) {
let file = &self.pool.files[index as usize];

Expand Down
2 changes: 1 addition & 1 deletion prost-reflect/src/descriptor/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ where
src: &'a mut B,
}

impl<'a, B> Buf for CopyBufAdapter<'a, B>
impl<B> Buf for CopyBufAdapter<'_, B>
where
B: Buf,
{
Expand Down
4 changes: 2 additions & 2 deletions prost-reflect/src/dynamic/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl DynamicMessageFieldSet {
pub(crate) fn iter<'a>(
&'a self,
message: &'a MessageDescriptor,
) -> impl Iterator<Item = ValueAndDescriptor> + 'a {
) -> impl Iterator<Item = ValueAndDescriptor<'a>> + 'a {
self.fields
.iter()
.filter_map(move |(&number, value)| match value {
Expand Down Expand Up @@ -179,7 +179,7 @@ impl DynamicMessageFieldSet {
pub(crate) fn iter_include_default<'a>(
&'a self,
message: &'a MessageDescriptor,
) -> impl Iterator<Item = ValueAndDescriptor> + 'a {
) -> impl Iterator<Item = ValueAndDescriptor<'a>> + 'a {
let fields = message
.fields()
.filter(move |f| !f.supports_presence() || self.has(f))
Expand Down
30 changes: 15 additions & 15 deletions prost-reflect/src/dynamic/serde/de/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use super::{

pub struct KindSeed<'a>(pub &'a Kind, pub &'a DeserializeOptions);

impl<'a, 'de> DeserializeSeed<'de> for KindSeed<'a> {
impl<'de> DeserializeSeed<'de> for KindSeed<'_> {
type Value = Value;

fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
Expand Down Expand Up @@ -64,7 +64,7 @@ pub struct MessageVisitor<'a>(pub &'a MessageDescriptor, pub &'a DeserializeOpti
pub struct MessageVisitorInner<'a>(pub &'a mut DynamicMessage, pub &'a DeserializeOptions);
pub struct EnumVisitor<'a>(pub &'a EnumDescriptor);

impl<'a, 'de> Visitor<'de> for ListVisitor<'a> {
impl<'de> Visitor<'de> for ListVisitor<'_> {
type Value = Vec<Value>;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -86,7 +86,7 @@ impl<'a, 'de> Visitor<'de> for ListVisitor<'a> {
}
}

impl<'a, 'de> Visitor<'de> for MapVisitor<'a> {
impl<'de> Visitor<'de> for MapVisitor<'_> {
type Value = HashMap<MapKey, Value>;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -133,7 +133,7 @@ impl<'a, 'de> Visitor<'de> for MapVisitor<'a> {
}
}

impl<'de> Visitor<'de> for DoubleVisitor {
impl Visitor<'_> for DoubleVisitor {
type Value = f64;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -178,7 +178,7 @@ impl<'de> Visitor<'de> for DoubleVisitor {
}
}

impl<'de> Visitor<'de> for FloatVisitor {
impl Visitor<'_> for FloatVisitor {
type Value = f32;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -235,7 +235,7 @@ impl<'de> Visitor<'de> for FloatVisitor {
}
}

impl<'de> Visitor<'de> for Int32Visitor {
impl Visitor<'_> for Int32Visitor {
type Value = i32;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -290,7 +290,7 @@ impl<'de> Visitor<'de> for Int32Visitor {
}
}

impl<'de> Visitor<'de> for Uint32Visitor {
impl Visitor<'_> for Uint32Visitor {
type Value = u32;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -345,7 +345,7 @@ impl<'de> Visitor<'de> for Uint32Visitor {
}
}

impl<'de> Visitor<'de> for Int64Visitor {
impl Visitor<'_> for Int64Visitor {
type Value = i64;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -392,7 +392,7 @@ impl<'de> Visitor<'de> for Int64Visitor {
}
}

impl<'de> Visitor<'de> for Uint64Visitor {
impl Visitor<'_> for Uint64Visitor {
type Value = u64;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -439,7 +439,7 @@ impl<'de> Visitor<'de> for Uint64Visitor {
}
}

impl<'de> Visitor<'de> for StringVisitor {
impl Visitor<'_> for StringVisitor {
type Value = String;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -463,7 +463,7 @@ impl<'de> Visitor<'de> for StringVisitor {
}
}

impl<'de> Visitor<'de> for BoolVisitor {
impl Visitor<'_> for BoolVisitor {
type Value = bool;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -479,7 +479,7 @@ impl<'de> Visitor<'de> for BoolVisitor {
}
}

impl<'de> Visitor<'de> for BytesVisitor {
impl Visitor<'_> for BytesVisitor {
type Value = Bytes;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -519,7 +519,7 @@ impl<'de> Visitor<'de> for BytesVisitor {
}
}

impl<'a, 'de> Visitor<'de> for MessageVisitor<'a> {
impl<'de> Visitor<'de> for MessageVisitor<'_> {
type Value = DynamicMessage;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -538,7 +538,7 @@ impl<'a, 'de> Visitor<'de> for MessageVisitor<'a> {
}
}

impl<'a, 'de> Visitor<'de> for MessageVisitorInner<'a> {
impl<'de> Visitor<'de> for MessageVisitorInner<'_> {
type Value = ();

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -588,7 +588,7 @@ impl<'a, 'de> Visitor<'de> for MessageVisitorInner<'a> {
}
}

impl<'a, 'de> Visitor<'de> for EnumVisitor<'a> {
impl Visitor<'_> for EnumVisitor<'_> {
type Value = i32;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
8 changes: 4 additions & 4 deletions prost-reflect/src/dynamic/serde/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where

struct MessageSeed<'a>(&'a MessageDescriptor, &'a DeserializeOptions);

impl<'a, 'de> DeserializeSeed<'de> for MessageSeed<'a> {
impl<'de> DeserializeSeed<'de> for MessageSeed<'_> {
type Value = DynamicMessage;

fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
Expand All @@ -100,7 +100,7 @@ impl<'a, 'de> DeserializeSeed<'de> for MessageSeed<'a> {

struct FieldDescriptorSeed<'a, T>(&'a T, &'a DeserializeOptions);

impl<'a, 'de, T> DeserializeSeed<'de> for FieldDescriptorSeed<'a, T>
impl<'de, T> DeserializeSeed<'de> for FieldDescriptorSeed<'_, T>
where
T: FieldDescriptorLike,
{
Expand All @@ -126,7 +126,7 @@ where

struct OptionalFieldDescriptorSeed<'a, T>(&'a T, &'a DeserializeOptions);

impl<'a, 'de, T> DeserializeSeed<'de> for OptionalFieldDescriptorSeed<'a, T>
impl<'de, T> DeserializeSeed<'de> for OptionalFieldDescriptorSeed<'_, T>
where
T: FieldDescriptorLike,
{
Expand All @@ -140,7 +140,7 @@ where
}
}

impl<'a, 'de, T> Visitor<'de> for OptionalFieldDescriptorSeed<'a, T>
impl<'de, T> Visitor<'de> for OptionalFieldDescriptorSeed<'_, T>
where
T: FieldDescriptorLike,
{
Expand Down
10 changes: 5 additions & 5 deletions prost-reflect/src/dynamic/serde/de/wkt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct GoogleProtobufStructVisitor;
pub struct GoogleProtobufValueVisitor;
pub struct GoogleProtobufEmptyVisitor;

impl<'a, 'de> Visitor<'de> for GoogleProtobufAnyVisitor<'a> {
impl<'de> Visitor<'de> for GoogleProtobufAnyVisitor<'_> {
type Value = prost_types::Any;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<'a, 'de> Visitor<'de> for GoogleProtobufAnyVisitor<'a> {
}
}

impl<'de> Visitor<'de> for GoogleProtobufNullVisitor {
impl Visitor<'_> for GoogleProtobufNullVisitor {
type Value = i32;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -158,7 +158,7 @@ impl<'de> Visitor<'de> for GoogleProtobufNullVisitor {
}
}

impl<'de> Visitor<'de> for GoogleProtobufTimestampVisitor {
impl Visitor<'_> for GoogleProtobufTimestampVisitor {
type Value = prost_types::Timestamp;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -179,7 +179,7 @@ impl<'de> Visitor<'de> for GoogleProtobufTimestampVisitor {
}
}

impl<'de> Visitor<'de> for GoogleProtobufDurationVisitor {
impl Visitor<'_> for GoogleProtobufDurationVisitor {
type Value = prost_types::Duration;

fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -198,7 +198,7 @@ impl<'de> Visitor<'de> for GoogleProtobufDurationVisitor {
}
}

impl<'de> Visitor<'de> for GoogleProtobufFieldMaskVisitor {
impl Visitor<'_> for GoogleProtobufFieldMaskVisitor {
type Value = prost_types::FieldMask;

fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
Expand Down
4 changes: 2 additions & 2 deletions prost-reflect/src/dynamic/serde/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ where
.serialize(serializer)
}

impl<'a> Serialize for SerializeWrapper<'a, DynamicMessage> {
impl Serialize for SerializeWrapper<'_, DynamicMessage> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down Expand Up @@ -237,7 +237,7 @@ impl<'a> Serialize for SerializeWrapper<'a, ValueAndKind<'a>> {
}
}

impl<'a> Serialize for SerializeWrapper<'a, MapKey> {
impl Serialize for SerializeWrapper<'_, MapKey> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
2 changes: 1 addition & 1 deletion prost-reflect/src/dynamic/serde/ser/wkt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ where
serialize_list_inner(&raw, serializer, options)
}

impl<'a> Serialize for SerializeWrapper<'a, prost_types::Value> {
impl Serialize for SerializeWrapper<'_, prost_types::Value> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
2 changes: 1 addition & 1 deletion prost-reflect/src/dynamic/text_format/parse/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub(crate) struct TokenExtras {
pub error: Option<ParseErrorKind>,
}

impl<'a> fmt::Display for Token<'a> {
impl fmt::Display for Token<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Token::Ident(value) => write!(f, "{}", value),
Expand Down

0 comments on commit db85a69

Please sign in to comment.