rinja-rs / rinja

https://rinja.readthedocs.io
Apache License 2.0
25 stars 4 forks source link

Add no_std feature? #15

Open Kijewski opened 2 weeks ago

Kijewski commented 2 weeks ago

I think the generated code can easily be #![no_std]. We only need std to impl std::error::Error for rinja::Error. We need alloc for a few filters. Both use cases can be feature-gated. Then I think, we can add the features ↓ and be useful to a marginally wider audience.

default = […, "std"]
std = ["alloc"]
alloc = []

What do you think?

GuillaumeGomez commented 2 weeks ago

Hum... Do you know any project where it could be useful? Because unless there is one, I'm not sure if it's worth it (even though it'd likely be a very small amount of code). I'm not against it, just not convinced.

Kijewski commented 2 weeks ago

No, spontaneously I cannot come up with a use cases. Probably there isn't one. I guess there won't be many IoT device developers who need a template engine. :)

GuillaumeGomez commented 2 weeks ago

Who knows? World is a surprising place.

dodomorandi commented 3 days ago

We only need std to impl std::error::Error for rinja::Error.

Just in case you decide to have a MSRV 1.81: https://github.com/rust-lang/rust/issues/103765

GuillaumeGomez commented 3 days ago

Oh nice, thanks for the information!