Comments (3)
So I finally had some time to experiment with this use case. There's probably not a straightforward fix for this: the Option
is owned by the template struct and so far Askama has always passed an immutable reference only. You can replace the clone()
you did by as_ref()
, which seems to have much the same result without doing an expensive clone, but the ergonomics aren't much better.
I'm still wondering whether I should change Askama to consume the struct instead, I'll play around and see if that would help with this issue.
from askama.
BTW, I think #54 would also help a lot by making it more ergonomic to use enums generally.
from askama.
So #54 has landed; I'll close this now.
from askama.
Related Issues (20)
- Macro doesn't resolve argument HOT 2
- First thing that's not None or empty HOT 3
- How to get the specified value in the array HOT 4
- Can I just {{ foo }} a template? HOT 3
- Compiling constants into template HOT 14
- Macros and indentation level inheritance HOT 16
- How to use super()? HOT 3
- Compile times scale with number of templates HOT 6
- Split `askama_derive` internals out into normal lib crate HOT 2
- Parse error when using macro with expanded module path HOT 3
- Reducing number of newlines in rendered templates HOT 1
- Can a child template choose its parent based on a condition? HOT 2
- Multiple outputs? HOT 1
- Fuzzing askama_parser results in panic HOT 3
- Can I pass None as arg to a macro? HOT 4
- Variable use with inheritence HOT 5
- askama_derive update breaks filter usage with spaces HOT 2
- question: xml templates support HOT 2
- relative template paths and include_str support HOT 7
- Generic iterator field for a template HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from askama.