git.delta.rocks / unique-network / refs/commits / 5b66126a12ff

difftreelog

fix generate stubs build ans remove warnings

Trubnikov Sergey2022-11-29parent: #31b1faa.patch.diff
in: master

4 files changed

modifiedcrates/evm-coder/procedural/src/abi_derive.rsdiffbeforeafterboth
--- a/crates/evm-coder/procedural/src/abi_derive.rs
+++ b/crates/evm-coder/procedural/src/abi_derive.rs
@@ -1,4 +1,3 @@
-use proc_macro2::TokenStream;
 use quote::quote;
 
 pub(crate) fn impl_abi_macro(ast: &syn::DeriveInput) -> syn::Result<proc_macro2::TokenStream> {
@@ -128,7 +127,7 @@
 	}
 }
 
-fn extract_docs(attrs: &Vec<syn::Attribute>) -> syn::Result<Vec<String>> {
+fn extract_docs(attrs: &[syn::Attribute]) -> syn::Result<Vec<String>> {
 	attrs
 		.iter()
 		.filter_map(|attr| {
@@ -163,7 +162,7 @@
 	}
 }
 
-fn map_field_to_type<'a>(field: &'a syn::Field) -> &'a syn::Type {
+fn map_field_to_type(field: &syn::Field) -> &syn::Type {
 	&field.ty
 }
 
@@ -177,7 +176,7 @@
 	}
 }
 
-fn impl_abi_type<'a>(
+fn impl_abi_type(
 	name: &syn::Ident,
 	tuple_type: proc_macro2::TokenStream,
 ) -> proc_macro2::TokenStream {
@@ -194,7 +193,7 @@
 	}
 }
 
-fn impl_abi_read<'a>(
+fn impl_abi_read(
 	name: &syn::Ident,
 	tuple_type: proc_macro2::TokenStream,
 	tuple_names: proc_macro2::TokenStream,
@@ -210,9 +209,9 @@
 	)
 }
 
-fn impl_abi_write<'a>(
+fn impl_abi_write(
 	name: &syn::Ident,
-	is_named_fields: bool,
+	_is_named_fields: bool,
 	tuple_type: proc_macro2::TokenStream,
 	tuple_data: proc_macro2::TokenStream,
 ) -> proc_macro2::TokenStream {
@@ -301,7 +300,7 @@
 	field_names: impl Iterator<Item = proc_macro2::Ident> + Clone,
 	field_types: impl Iterator<Item = &'a syn::Type> + Clone,
 	field_docs: impl Iterator<Item = syn::Result<Vec<String>>> + Clone,
-	docs: &Vec<String>,
+	docs: &[String],
 ) -> syn::Result<proc_macro2::TokenStream> {
 	let string_name = name.to_string();
 	let name_type = field_names
modifiedcrates/evm-coder/src/abi/impls.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/abi/impls.rs
+++ b/crates/evm-coder/src/abi/impls.rs
@@ -165,7 +165,7 @@
 }
 
 impl AbiWrite for Property {
-	fn abi_write<'a>(&'a self, writer: &mut AbiWriter) {
+	fn abi_write(&self, writer: &mut AbiWriter) {
 		(&self.key, &self.value).abi_write(writer);
 	}
 }
modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -146,7 +146,7 @@
 	#[cfg(feature = "std")]
 	pub type string = ::std::string::String;
 
-	#[derive(Default, Debug, PartialEq, Clone)]
+	#[derive(Default, Debug, PartialEq, Eq, Clone)]
 	pub struct bytes(pub Vec<u8>);
 
 	/// Solidity doesn't have `void` type, however we have special implementation
modifiedcrates/evm-coder/src/solidity/impls.rsdiffbeforeafterboth
132impl_tuples! {A B C D E F G H I}132impl_tuples! {A B C D E F G H I}
133impl_tuples! {A B C D E F G H I J}133impl_tuples! {A B C D E F G H I J}
134134
135impl sealed::CanBePlacedInVec for Property {}
136impl StructCollect for Property {135impl StructCollect for Property {
137 fn name() -> String {136 fn name() -> String {
138 "Property".into()137 "Property".into()
139 }138 }
140139
141 fn declaration() -> String {140 fn declaration() -> String {
141 use std::fmt::Write;
142
142 let mut str = String::new();143 let mut str = String::new();
143 writeln!(str, "/// @dev Property struct").unwrap();144 writeln!(str, "/// @dev Property struct").unwrap();
167 }168 }
168}169}
169170
170impl SolidityTupleType for Property {171impl SolidityType for Property {
171 fn names(tc: &TypeCollector) -> Vec<string> {172 fn names(tc: &TypeCollector) -> Vec<string> {
172 let mut collected = Vec::with_capacity(Self::len());173 let mut collected = Vec::with_capacity(Self::len());
173 {174 {