Skip to content

Rename LoopItem::index to LoopItem::index0#481

Merged
GuillaumeGomez merged 1 commit intoaskama-rs:masterfrom
Kijewski:pr-index0
Jun 11, 2025
Merged

Rename LoopItem::index to LoopItem::index0#481
GuillaumeGomez merged 1 commit intoaskama-rs:masterfrom
Kijewski:pr-index0

Conversation

@Kijewski
Copy link
Copy Markdown
Member

That's what the element is called in the template syntax.

Also refactor Generator::visit_attr() at bit to make it more readable.
Also add __askama prefix to _len.

That's what the element is called in the template syntax.

Also refactor `Generator::visit_attr()` at bit to make it more readable.
Also add `__askama` prefix to `_len`.
return Ok(DisplayWrap::Unwrapped);
} else {
return Err(ctx.generate_error("unknown loop variable", obj.span()));
if let Expr::Var("loop") = **obj {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is so much better!

@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit 163d978 into askama-rs:master Jun 11, 2025
42 checks passed
@Kijewski Kijewski deleted the pr-index0 branch June 11, 2025 17:28
@Kijewski Kijewski mentioned this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants