djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.47k stars 219 forks source link

Revert "Add automatic borrowing to `let` statements" #938

Closed GuillaumeGomez closed 10 months ago

GuillaumeGomez commented 10 months ago

Reverts djc/askama#922

As discussed in https://github.com/djc/askama/pull/937, this was actually a pretty bad idea to do this. We'll need to discuss about potential ways to go around this limit but in the meantime, better revert it.

@PizzasBear: Can't you write a filter as_ref which takes a ref and returns a ref in the meantime to go around the limitation in your case?

PizzasBear commented 10 months ago

I could use an as_ref filter instead, but I don't think you should revert the bugfix.

djc commented 10 months ago

@GuillaumeGomez when you have a chance, could you remove the second commit here?

GuillaumeGomez commented 10 months ago

Updated!