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

Declaring reusable variables #78

Open
OskarPersson opened this issue May 17, 2020 · 1 comment
Open

Declaring reusable variables #78

OskarPersson opened this issue May 17, 2020 · 1 comment

Comments

@OskarPersson
Copy link

Is there something similar to Django's with tag to store result of complex or expensive methods for use in the template multiple times?

@kaj
Copy link
Owner

kaj commented May 21, 2020

Not really, unles you count @if let ..., @match ..., or function / template calls.

It has been suggested before, so maybe it is a good idea. I guess there could be an @let template tag similar to @if let, but with an irrefutable pattern (you can actually use @if let variable = expression { ... }, but rustc will give you a warning about the "irrefutable if-let pattern").

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

No branches or pull requests

2 participants