nickel-org/nickel.rs — pull request #70 by SimonPersson (2014-09-19 19:57:25+00:00)
Title: Add mustache support, take two!

So I gave this a new shot and I'm much happier with the design now.

The Response object now have a render function so the following can be used to send a template as a response:
```
fn handler (_request: &Request, response: &mut Response) {
let mut data = HashMap::<&'static str, &'static str>::new();
data.insert("name", "Simon");
response.render("examples/assets/template.htm", &data);
}
```

The templates are shared between all requests with an Arc so that no unnecessary copying has to take place.

The only thing bothering me a little bit is that response.render() always retrieve the templates in write mode. We should really use write mode only when we have to write but I couldn't find a nice solution to this problem right now that didn't look horrible.

This closes #68.