Commit graph

7 commits

Author SHA1 Message Date
Chris Wong
c05bb02d97 Remove call expressions 2016-09-23 19:36:42 +12:00
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
7045191c19 Add the "call" keyword back in
This change should make the syntax look a bit less mysterious
2016-09-02 23:23:39 +12:00
Chris Wong
ed9228fa93 Require parentheses around calls
This simplifies the parser quite a bit
2016-08-22 21:53:23 +12:00
Chris Wong
6a6b23d8ae Switch to new splice syntax using parentheses
Closes 
2016-08-18 22:12:14 +12:00
Chris Wong
61791a6aef @call yay -> @yay 2016-08-15 20:46:04 +12:00
Chris Wong
1ec48a3725 Refactor tests
Closes 
2016-07-31 21:34:46 +12:00