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

Change filters/functions/tests to borrow arguments #97

Closed
mitsuhiko opened this issue Sep 3, 2022 · 2 comments · Fixed by #115
Closed

Change filters/functions/tests to borrow arguments #97

mitsuhiko opened this issue Sep 3, 2022 · 2 comments · Fixed by #115

Comments

@mitsuhiko
Copy link
Owner

It's currently quite wasteful that a filter like lower always needs to convert into a String first. It would be a better interface if &Value or similar is passed, then a borrow to a &str out of that should be possible for the interface.

This was referenced Sep 3, 2022
@mitsuhiko
Copy link
Owner Author

Entirely unclear how this can be done without GATs at moment or awful hacks I don't feel confident about.

@mitsuhiko
Copy link
Owner Author

mitsuhiko commented Sep 11, 2022

I found a way to make this work now in #97 but unfortunately there does not appear to be a way to make this work for Rust versions below 1.61.0 without resorting to a lot of generated code and ugly trait bounds.

I'm not sure at the moment what a good strategy is here. I am somewhat willing to bump this up on minijinja as my own use of this crate does not require supporting old Rust compilers.

If someone has opinions, there is a poll now: #116

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 a pull request may close this issue.

1 participant