Commit graph

4 commits

Author SHA1 Message Date
Chris Wong
f12efe4299 Rewrite everything to use Strings instead of writers
After fiddling around with zero-allocation solutions, I concluded that
all non-allocating approaches are too annoying to work with in realistic
code. Using closures leads to yak-shaving with lifetimes; and because
Iron needs to take ownership of the response body we often end up
cloning the input data anyway.

Removing this constraint has let me simplify the entire system, removing
a net 300 lines from the library. The `html!` macro no longer takes a
writer, and instead returns a `PreEscaped<String>`. This means that the
result of an `html!` can be spliced directly into another `html!`,
removing the need for the `impl Template` rigmarole.

To rub it in, benchmarks show the new code is in fact *faster* than it
was before. How lovely.
2016-09-23 19:22:22 +12:00
Chris Wong
97a71d7bc3 Require that all literal strings are quoted
Unquoted literals are confusing, annoying to implement, and rarely used.
We're better off without them.
2016-08-18 22:31:12 +12:00
Chris Wong
d2bf70da9a Allow names with multiple hyphens in a row
Fixes 
2016-08-07 20:39:31 +12:00
Chris Wong
1ec48a3725 Refactor tests
Closes 
2016-07-31 21:34:46 +12:00