Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Environment::templates()' iterator #471

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

SergioBenitez
Copy link
Contributor

A mechanism to iterate over all loaded templates

@mitsuhiko mitsuhiko merged commit fbc096c into mitsuhiko:minijinja-2 Apr 4, 2024
15 of 16 checks passed
@mitsuhiko
Copy link
Owner

I fixed the test on the branch so I merged it. I do wonder though if the name needs returning since template.name() returns it anyways.

@SergioBenitez
Copy link
Contributor Author

SergioBenitez commented Apr 4, 2024

I fixed the test on the branch so I merged it. I do wonder though if the name needs returning since template.name() returns it anyways.

The lifetimes for the strings are different, but I imagine it won't matter most of the time. I didn't realize there was a Template::name() -- I think it makes sense to just return an iterator over Templates in that case.

@mitsuhiko
Copy link
Owner

@SergioBenitez the lifetimes could in theory be adjusted by making Template::name() return the 'source lifetime which is probably a good idea anyways.

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