Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ impl TypeInfoImpl {
});

Ok(quote! {
#[automatically_derived]
impl #impl_generics #scale_info::TypeInfo for #ident #ty_generics #where_clause {
type Identity = Self;
fn type_info() -> #scale_info::Type {
Expand Down
4 changes: 2 additions & 2 deletions derive/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn type_contains_idents(ty: &Type, idents: &[Ident]) -> bool {
idents: &'a [Ident],
}

impl<'a, 'ast> Visit<'ast> for ContainIdents<'a> {
impl<'ast> Visit<'ast> for ContainIdents<'_> {
fn visit_ident(&mut self, i: &'ast Ident) {
if self.idents.iter().any(|id| id == i) {
self.result = true;
Expand All @@ -145,7 +145,7 @@ fn type_or_sub_type_path_starts_with_ident(ty: &Type, ident: &Ident) -> bool {
ident: &'a Ident,
}

impl<'a, 'ast> Visit<'ast> for TypePathStartsWithIdent<'a> {
impl<'ast> Visit<'ast> for TypePathStartsWithIdent<'_> {
fn visit_type_path(&mut self, i: &'ast TypePath) {
if i.qself.is_none() {
if let Some(segment) = i.path.segments.first() {
Expand Down
6 changes: 3 additions & 3 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fn basic_enum_with_index() {
#[allow(unused)]
#[derive(Encode)]
enum IndexedRustEnum {
#[codec(index = 3)]
#[codec(index = 4)]
A(bool),
#[codec(index = 0)]
B {
Expand All @@ -312,7 +312,7 @@ fn basic_enum_with_index() {
.variant(
Variants::new()
.variant("A", |v| {
v.index(3).fields(
v.index(4).fields(
Fields::unnamed().field(|f| f.ty::<bool>().type_name("bool")),
)
})
Expand All @@ -338,7 +338,7 @@ fn basic_enum_with_index() {
.variant(
Variants::new()
.variant("A", |v| {
v.index(3)
v.index(4)
.fields(Fields::unnamed().field(|f| f.ty::<bool>().type_name("bool")))
})
.variant("B", |v| {
Expand Down
Loading