Skip to content

Commit f4c48ec

Browse files
authored
Merge pull request #36 from jieyouxu/fix-tuple-index
2 parents 29e4d65 + 822f9cc commit f4c48ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

convey_derive/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ pub fn render_output(input: TokenStream) -> TokenStream {
6868
let field_count = s.fields.iter().count();
6969
let fields = (0..field_count)
7070
.fold(Vec::new(), |mut res, i| {
71-
res.push(quote! { span = span.add_item(convey::components::text(&self.#i.to_string())); });
71+
let field_name = syn::Index::from(i);
72+
res.push(quote! { span = span.add_item(convey::components::text(&self.#field_name.to_string())); });
7273
if i < field_count - 1 {
7374
res.push(quote! { span = span.add_item(", "); });
7475
}

0 commit comments

Comments
 (0)