Skip to content

Commit 35da5f2

Browse files
nickbpstepancheg
authored andcommitted
Fix generated code with rust_2018_idioms
Fixes #435: "hidden lifetime parameters in types are deprecated" against generated code when `rust_2018_idioms` is enabled in a project.
1 parent 5f07451 commit 35da5f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

protobuf-codegen/src/message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<'a> MessageGen<'a> {
131131

132132
fn write_write_to_with_cached_sizes(&self, w: &mut CodeWriter) {
133133
let sig = format!(
134-
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream) -> {}::ProtobufResult<()>",
134+
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream<'_>) -> {}::ProtobufResult<()>",
135135
protobuf_crate_path(&self.customize),
136136
protobuf_crate_path(&self.customize),
137137
);
@@ -231,7 +231,7 @@ impl<'a> MessageGen<'a> {
231231

232232
fn write_merge_from(&self, w: &mut CodeWriter) {
233233
let sig = format!(
234-
"merge_from(&mut self, is: &mut {}::CodedInputStream) -> {}::ProtobufResult<()>",
234+
"merge_from(&mut self, is: &mut {}::CodedInputStream<'_>) -> {}::ProtobufResult<()>",
235235
protobuf_crate_path(&self.customize),
236236
protobuf_crate_path(&self.customize),
237237
);
@@ -403,7 +403,7 @@ impl<'a> MessageGen<'a> {
403403
fn write_impl_show(&self, w: &mut CodeWriter) {
404404
w.impl_for_block("::std::fmt::Debug", &self.type_name, |w| {
405405
w.def_fn(
406-
"fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result",
406+
"fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result",
407407
|w| {
408408
w.write_line("::protobuf::text_format::fmt(self, f)");
409409
},

0 commit comments

Comments
 (0)