Use a tuple with the content and the index

This commit is contained in:
Yash Karandikar 2021-11-07 10:10:33 -06:00
parent 0cde579166
commit 0f113c399c
Signed by: karx
GPG key ID: A794DA2529474BA5

View file

@ -42,7 +42,7 @@ fn main() {
None => ""
});
builder.push(string);
builder.push((string, i));
}
items.set(builder);
@ -66,9 +66,9 @@ fn main() {
Keyed(KeyedProps {
iterable: items.handle(),
template: |x| template! {
li {(x)}
li {(x.0.clone())}
},
key: |x| (*x).clone(),
key: |x| (*x).1,
})
}
}