Skip to content

Commit 9ca79a4

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 d2a9ddb commit 9ca79a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

protobuf-codegen/src/message.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl<'a> MessageGen<'a> {
189189

190190
fn write_write_to_with_cached_sizes(&self, w: &mut CodeWriter) {
191191
let sig = format!(
192-
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream) -> {}::ProtobufResult<()>",
192+
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream<'_>) -> {}::ProtobufResult<()>",
193193
protobuf_crate_path(&self.customize),
194194
protobuf_crate_path(&self.customize),
195195
);
@@ -292,7 +292,7 @@ impl<'a> MessageGen<'a> {
292292

293293
fn write_merge_from(&self, w: &mut CodeWriter) {
294294
let sig = format!(
295-
"merge_from(&mut self, is: &mut {}::CodedInputStream) -> {}::ProtobufResult<()>",
295+
"merge_from(&mut self, is: &mut {}::CodedInputStream<'_>) -> {}::ProtobufResult<()>",
296296
protobuf_crate_path(&self.customize),
297297
protobuf_crate_path(&self.customize),
298298
);
@@ -437,7 +437,7 @@ impl<'a> MessageGen<'a> {
437437
fn write_impl_show(&self, w: &mut CodeWriter) {
438438
w.impl_for_block("::std::fmt::Debug", &format!("{}", self.type_name), |w| {
439439
w.def_fn(
440-
"fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result",
440+
"fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result",
441441
|w| {
442442
w.write_line(&format!(
443443
"{}::text_format::fmt(self, f)",

0 commit comments

Comments
 (0)