difftreelog
fix generate stubs build ans remove warnings
in: master
4 files changed
crates/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
crates/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);
}
}
crates/evm-coder/src/lib.rsdiffbeforeafterboth146 #[cfg(feature = "std")]146 #[cfg(feature = "std")]147 pub type string = ::std::string::String;147 pub type string = ::std::string::String;148148149 #[derive(Default, Debug, PartialEq, Clone)]149 #[derive(Default, Debug, PartialEq, Eq, Clone)]150 pub struct bytes(pub Vec<u8>);150 pub struct bytes(pub Vec<u8>);151151152 /// Solidity doesn't have `void` type, however we have special implementation152 /// Solidity doesn't have `void` type, however we have special implementationcrates/evm-coder/src/solidity/impls.rsdiffbeforeafterboth--- a/crates/evm-coder/src/solidity/impls.rs
+++ b/crates/evm-coder/src/solidity/impls.rs
@@ -132,13 +132,14 @@
impl_tuples! {A B C D E F G H I}
impl_tuples! {A B C D E F G H I J}
-impl sealed::CanBePlacedInVec for Property {}
impl StructCollect for Property {
fn name() -> String {
"Property".into()
}
fn declaration() -> String {
+ use std::fmt::Write;
+
let mut str = String::new();
writeln!(str, "/// @dev Property struct").unwrap();
writeln!(str, "struct {} {{", Self::name()).unwrap();
@@ -167,7 +168,7 @@
}
}
-impl SolidityTupleType for Property {
+impl SolidityType for Property {
fn names(tc: &TypeCollector) -> Vec<string> {
let mut collected = Vec::with_capacity(Self::len());
{