render-rs / render.rs

🔏 A safe and simple template engine with the ergonomics of JSX
https://docs.rs/render
MIT License
238 stars 23 forks source link

False positive on `unused_braces` lint? #18

Closed vpzomtrrfrt closed 4 years ago

vpzomtrrfrt commented 4 years ago

Using the macros in this module seems to trigger a lint failure:

warning: unnecessary braces around function argument
  --> render_tests/src/lib.rs:72:28
   |
72 |               <head><title>{title}</title></head>
   |                            ^^^^^^^ help: remove these braces
   |
   = note: `#[warn(unused_braces)]` on by default

I assume this is not supposed to happen, since removing the braces doesn't work

Schniz commented 4 years ago

I agree. That’s because of the generated code. I have a POC that silences some of the errors - but I find it weird that these stylistic linting rules even run on generated code. We need to dig into that and fix the warnings it generates 😳

daaku commented 4 years ago

This has been fixed in 02548be3!

Schniz commented 4 years ago

Yup! Thanks for the hard work @daaku!