From c5446983be3b9d8d49ee39b443ed4fabd8f35440 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Sun, 29 Apr 2018 21:34:35 +0300 Subject: [PATCH] Remove `Option` param from `Message::descriptor_static` function. It is no longer needed in modern Rust. --- protobuf-codegen/src/message.rs | 4 +- protobuf-test-common/src/test.rs | 2 +- protobuf/src/core.rs | 3 +- protobuf/src/descriptor.rs | 100 +++++++++--------- protobuf/src/plugin.rs | 12 +-- protobuf/src/reflect/mod.rs | 2 +- protobuf/src/well_known_types/any.rs | 4 +- protobuf/src/well_known_types/api.rs | 12 +-- protobuf/src/well_known_types/duration.rs | 4 +- protobuf/src/well_known_types/empty.rs | 4 +- protobuf/src/well_known_types/field_mask.rs | 4 +- .../src/well_known_types/source_context.rs | 4 +- protobuf/src/well_known_types/struct_pb.rs | 12 +-- protobuf/src/well_known_types/timestamp.rs | 4 +- protobuf/src/well_known_types/type_pb.rs | 20 ++-- protobuf/src/well_known_types/wrappers.rs | 36 +++---- 16 files changed, 113 insertions(+), 114 deletions(-) diff --git a/protobuf-codegen/src/message.rs b/protobuf-codegen/src/message.rs index 1f247fc93..661f8702d 100644 --- a/protobuf-codegen/src/message.rs +++ b/protobuf-codegen/src/message.rs @@ -256,7 +256,7 @@ impl<'a> MessageGen<'a> { } fn write_descriptor_static(&self, w: &mut CodeWriter) { - w.def_fn(&format!("descriptor_static(_: ::std::option::Option<{}>) -> &'static ::protobuf::reflect::MessageDescriptor", self.type_name), |w| { + w.def_fn(&format!("descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor"), |w| { w.lazy_static_decl_get("descriptor", "::protobuf::reflect::MessageDescriptor", |w| { let fields = self.fields_except_group(); if fields.is_empty() { @@ -332,7 +332,7 @@ impl<'a> MessageGen<'a> { }); w.write_line(""); w.def_fn("descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor", |w| { - w.write_line("::protobuf::Message::descriptor_static(None::)"); + w.write_line("Self::descriptor_static()"); }); w.write_line(""); w.def_fn(&format!("new() -> {}", self.type_name), |w| { diff --git a/protobuf-test-common/src/test.rs b/protobuf-test-common/src/test.rs index 20d90ed3c..bce7aa34a 100644 --- a/protobuf-test-common/src/test.rs +++ b/protobuf-test-common/src/test.rs @@ -24,7 +24,7 @@ pub fn test_serialize_deserialize(hex: &str, msg: &M) { expected_hex, serialized_hex, "message {}", - M::descriptor_static(None).name() + M::descriptor_static().name() ); let parsed = parse_from_bytes::(&expected_bytes).unwrap(); assert_eq!(*msg, parsed); diff --git a/protobuf/src/core.rs b/protobuf/src/core.rs index 0b38c6182..a9e9e3d21 100644 --- a/protobuf/src/core.rs +++ b/protobuf/src/core.rs @@ -168,8 +168,7 @@ pub trait Message: fmt::Debug + Clear + Any + Send + Sync { fn new() -> Self where Self : Sized; /// Get message descriptor for message type. - // http://stackoverflow.com/q/20342436/15018 - fn descriptor_static(_: Option) -> &'static MessageDescriptor + fn descriptor_static() -> &'static MessageDescriptor where Self : Sized { panic!( diff --git a/protobuf/src/descriptor.rs b/protobuf/src/descriptor.rs index acba5e1e0..2f241a236 100644 --- a/protobuf/src/descriptor.rs +++ b/protobuf/src/descriptor.rs @@ -132,14 +132,14 @@ impl ::protobuf::Message for FileDescriptorSet { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FileDescriptorSet { FileDescriptorSet::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -776,14 +776,14 @@ impl ::protobuf::Message for FileDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FileDescriptorProto { FileDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1402,14 +1402,14 @@ impl ::protobuf::Message for DescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> DescriptorProto { DescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1649,14 +1649,14 @@ impl ::protobuf::Message for DescriptorProto_ExtensionRange { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> DescriptorProto_ExtensionRange { DescriptorProto_ExtensionRange::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1848,14 +1848,14 @@ impl ::protobuf::Message for DescriptorProto_ReservedRange { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> DescriptorProto_ReservedRange { DescriptorProto_ReservedRange::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2386,14 +2386,14 @@ impl ::protobuf::Message for FieldDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FieldDescriptorProto { FieldDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2813,14 +2813,14 @@ impl ::protobuf::Message for OneofDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> OneofDescriptorProto { OneofDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3086,14 +3086,14 @@ impl ::protobuf::Message for EnumDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> EnumDescriptorProto { EnumDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3355,14 +3355,14 @@ impl ::protobuf::Message for EnumValueDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> EnumValueDescriptorProto { EnumValueDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3634,14 +3634,14 @@ impl ::protobuf::Message for ServiceDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> ServiceDescriptorProto { ServiceDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4028,14 +4028,14 @@ impl ::protobuf::Message for MethodDescriptorProto { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> MethodDescriptorProto { MethodDescriptorProto::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4751,14 +4751,14 @@ impl ::protobuf::Message for FileOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FileOptions { FileOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5189,14 +5189,14 @@ impl ::protobuf::Message for MessageOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> MessageOptions { MessageOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5573,14 +5573,14 @@ impl ::protobuf::Message for FieldOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FieldOptions { FieldOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5883,14 +5883,14 @@ impl ::protobuf::Message for OneofOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> OneofOptions { OneofOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6119,14 +6119,14 @@ impl ::protobuf::Message for EnumOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> EnumOptions { EnumOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6334,14 +6334,14 @@ impl ::protobuf::Message for EnumValueOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> EnumValueOptions { EnumValueOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6543,14 +6543,14 @@ impl ::protobuf::Message for ServiceOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> ServiceOptions { ServiceOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6752,14 +6752,14 @@ impl ::protobuf::Message for MethodOptions { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> MethodOptions { MethodOptions::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -7165,14 +7165,14 @@ impl ::protobuf::Message for UninterpretedOption { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> UninterpretedOption { UninterpretedOption::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -7413,14 +7413,14 @@ impl ::protobuf::Message for UninterpretedOption_NamePart { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> UninterpretedOption_NamePart { UninterpretedOption_NamePart::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -7589,14 +7589,14 @@ impl ::protobuf::Message for SourceCodeInfo { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> SourceCodeInfo { SourceCodeInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -7923,14 +7923,14 @@ impl ::protobuf::Message for SourceCodeInfo_Location { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> SourceCodeInfo_Location { SourceCodeInfo_Location::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -8117,14 +8117,14 @@ impl ::protobuf::Message for GeneratedCodeInfo { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> GeneratedCodeInfo { GeneratedCodeInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -8396,14 +8396,14 @@ impl ::protobuf::Message for GeneratedCodeInfo_Annotation { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> GeneratedCodeInfo_Annotation { GeneratedCodeInfo_Annotation::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/plugin.rs b/protobuf/src/plugin.rs index b2d3a33f6..1060ee6e2 100644 --- a/protobuf/src/plugin.rs +++ b/protobuf/src/plugin.rs @@ -213,14 +213,14 @@ impl ::protobuf::Message for CodeGeneratorRequest { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> CodeGeneratorRequest { CodeGeneratorRequest::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -441,14 +441,14 @@ impl ::protobuf::Message for CodeGeneratorResponse { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> CodeGeneratorResponse { CodeGeneratorResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -712,14 +712,14 @@ impl ::protobuf::Message for CodeGeneratorResponse_File { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> CodeGeneratorResponse_File { CodeGeneratorResponse_File::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/reflect/mod.rs b/protobuf/src/reflect/mod.rs index eeccb31ed..f9eb34754 100644 --- a/protobuf/src/reflect/mod.rs +++ b/protobuf/src/reflect/mod.rs @@ -154,7 +154,7 @@ pub struct MessageDescriptor { impl MessageDescriptor { pub fn for_type() -> &'static MessageDescriptor { - Message::descriptor_static(None::) + M::descriptor_static() } pub fn new( diff --git a/protobuf/src/well_known_types/any.rs b/protobuf/src/well_known_types/any.rs index b2ad6539f..dd3c9bfc5 100644 --- a/protobuf/src/well_known_types/any.rs +++ b/protobuf/src/well_known_types/any.rs @@ -161,14 +161,14 @@ impl ::protobuf::Message for Any { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Any { Any::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/api.rs b/protobuf/src/well_known_types/api.rs index ccbe0cda2..e43ad6090 100644 --- a/protobuf/src/well_known_types/api.rs +++ b/protobuf/src/well_known_types/api.rs @@ -366,14 +366,14 @@ impl ::protobuf::Message for Api { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Api { Api::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -763,14 +763,14 @@ impl ::protobuf::Message for Method { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Method { Method::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -998,14 +998,14 @@ impl ::protobuf::Message for Mixin { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Mixin { Mixin::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/duration.rs b/protobuf/src/well_known_types/duration.rs index 0110ad79f..b06398fde 100644 --- a/protobuf/src/well_known_types/duration.rs +++ b/protobuf/src/well_known_types/duration.rs @@ -147,14 +147,14 @@ impl ::protobuf::Message for Duration { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Duration { Duration::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/empty.rs b/protobuf/src/well_known_types/empty.rs index b3c86dc4c..fe5aeff56 100644 --- a/protobuf/src/well_known_types/empty.rs +++ b/protobuf/src/well_known_types/empty.rs @@ -88,14 +88,14 @@ impl ::protobuf::Message for Empty { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Empty { Empty::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/field_mask.rs b/protobuf/src/well_known_types/field_mask.rs index 12251830d..14b2b9a8e 100644 --- a/protobuf/src/well_known_types/field_mask.rs +++ b/protobuf/src/well_known_types/field_mask.rs @@ -124,14 +124,14 @@ impl ::protobuf::Message for FieldMask { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> FieldMask { FieldMask::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/source_context.rs b/protobuf/src/well_known_types/source_context.rs index 36b4c587b..39d61af3c 100644 --- a/protobuf/src/well_known_types/source_context.rs +++ b/protobuf/src/well_known_types/source_context.rs @@ -125,14 +125,14 @@ impl ::protobuf::Message for SourceContext { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> SourceContext { SourceContext::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/struct_pb.rs b/protobuf/src/well_known_types/struct_pb.rs index bbb1904cc..ebcbc497f 100644 --- a/protobuf/src/well_known_types/struct_pb.rs +++ b/protobuf/src/well_known_types/struct_pb.rs @@ -120,14 +120,14 @@ impl ::protobuf::Message for Struct { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Struct { Struct::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -576,14 +576,14 @@ impl ::protobuf::Message for Value { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Value { Value::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -776,14 +776,14 @@ impl ::protobuf::Message for ListValue { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> ListValue { ListValue::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/timestamp.rs b/protobuf/src/well_known_types/timestamp.rs index 6efa3a337..906eeade0 100644 --- a/protobuf/src/well_known_types/timestamp.rs +++ b/protobuf/src/well_known_types/timestamp.rs @@ -147,14 +147,14 @@ impl ::protobuf::Message for Timestamp { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Timestamp { Timestamp::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, diff --git a/protobuf/src/well_known_types/type_pb.rs b/protobuf/src/well_known_types/type_pb.rs index fe2be5f1b..c26396d61 100644 --- a/protobuf/src/well_known_types/type_pb.rs +++ b/protobuf/src/well_known_types/type_pb.rs @@ -322,14 +322,14 @@ impl ::protobuf::Message for Type { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Type { Type::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -803,14 +803,14 @@ impl ::protobuf::Message for Field { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Field { Field::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1349,14 +1349,14 @@ impl ::protobuf::Message for Enum { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Enum { Enum::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1608,14 +1608,14 @@ impl ::protobuf::Message for EnumValue { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> EnumValue { EnumValue::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1834,14 +1834,14 @@ impl ::protobuf::Message for Option { } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::Message::descriptor_static(None::) + Self::descriptor_static() } fn new() -> Option { Option::new() } - fn descriptor_static(_: ::std::option::Option