lambda-fairy / maud

:pencil: Compile-time HTML templates for Rust
https://maud.lambda.xyz
Apache License 2.0
2.13k stars 142 forks source link

Use a dedicated MarkupSink type, rather than calling std::fmt::Write directly #3

Closed lambda-fairy closed 9 years ago

lambda-fairy commented 9 years ago

Since std::fmt::Write is marked as unstable, anyone who uses Maud would get unstable warnings in their code.

We can initially make MarkupSink a newtype around &mut fmt::Write. It should expose .write_str() and .write_fmt() which forward directly to the inner Write, as well as .as_escaped() which creates an Escaper wrapper.

lambda-fairy commented 9 years ago

Now that std::fmt::Write is stable, this is no longer a bug per se. But it'll still be a nice thing to have.

lambda-fairy commented 9 years ago

I've changed my mind since, so this bug is no longer valid.