Address edition-2018 idioms. (#929)

This commit is contained in:
Roman Borschel
2019-02-11 14:58:15 +01:00
committed by Pierre Krieger
parent 21810e46bd
commit eeed66707b
75 changed files with 308 additions and 516 deletions

View File

@@ -218,7 +218,7 @@ impl ::protobuf::Message for Message {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
@@ -282,7 +282,7 @@ impl ::protobuf::Message for Message {
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if let Some(v) = self.field_type {
os.write_enum(1, v.value())?;
}
@@ -323,13 +323,13 @@ impl ::protobuf::Message for Message {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
@@ -412,13 +412,13 @@ impl ::protobuf::Clear for Message {
}
impl ::std::fmt::Debug for Message {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Message {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
@@ -525,7 +525,7 @@ impl ::protobuf::Message for Message_Peer {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
@@ -564,7 +564,7 @@ impl ::protobuf::Message for Message_Peer {
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if let Some(ref v) = self.id.as_ref() {
os.write_bytes(1, &v)?;
}
@@ -590,13 +590,13 @@ impl ::protobuf::Message for Message_Peer {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
@@ -661,13 +661,13 @@ impl ::protobuf::Clear for Message_Peer {
}
impl ::std::fmt::Debug for Message_Peer {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Message_Peer {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
@@ -734,7 +734,7 @@ impl ::std::default::Default for Message_MessageType {
}
impl ::protobuf::reflect::ProtobufValue for Message_MessageType {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
}
}
@@ -795,7 +795,7 @@ impl ::std::default::Default for Message_ConnectionType {
}
impl ::protobuf::reflect::ProtobufValue for Message_ConnectionType {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
}
}