Skip to content

Commit

Permalink
Fix generated code with rust_2018_idioms
Browse files Browse the repository at this point in the history
Fixes #435: "hidden lifetime parameters in types are deprecated" against generated code when `rust_2018_idioms` is enabled in a project.
  • Loading branch information
nickbp authored and stepancheg committed Aug 1, 2019
1 parent d2a9ddb commit 9ca79a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions protobuf-codegen/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'a> MessageGen<'a> {

fn write_write_to_with_cached_sizes(&self, w: &mut CodeWriter) {
let sig = format!(
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream) -> {}::ProtobufResult<()>",
"write_to_with_cached_sizes(&self, os: &mut {}::CodedOutputStream<'_>) -> {}::ProtobufResult<()>",
protobuf_crate_path(&self.customize),
protobuf_crate_path(&self.customize),
);
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<'a> MessageGen<'a> {

fn write_merge_from(&self, w: &mut CodeWriter) {
let sig = format!(
"merge_from(&mut self, is: &mut {}::CodedInputStream) -> {}::ProtobufResult<()>",
"merge_from(&mut self, is: &mut {}::CodedInputStream<'_>) -> {}::ProtobufResult<()>",
protobuf_crate_path(&self.customize),
protobuf_crate_path(&self.customize),
);
Expand Down Expand Up @@ -437,7 +437,7 @@ impl<'a> MessageGen<'a> {
fn write_impl_show(&self, w: &mut CodeWriter) {
w.impl_for_block("::std::fmt::Debug", &format!("{}", self.type_name), |w| {
w.def_fn(
"fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result",
"fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result",
|w| {
w.write_line(&format!(
"{}::text_format::fmt(self, f)",
Expand Down

0 comments on commit 9ca79a4

Please sign in to comment.