mirror of https://github.com/rwf2/Rocket.git
parent
72bed509b9
commit
944eaa3e3c
|
@ -22,14 +22,15 @@ impl Engine for Tera {
|
||||||
// Finally try to tell Tera about all of the templates.
|
// Finally try to tell Tera about all of the templates.
|
||||||
if let Err(e) = tera.add_template_files(tera_templates) {
|
if let Err(e) = tera.add_template_files(tera_templates) {
|
||||||
error!("Failed to initialize Tera templating.");
|
error!("Failed to initialize Tera templating.");
|
||||||
for error in e.iter().skip(1) {
|
for error in e.iter() {
|
||||||
info_!("{}.", error);
|
info_!("{}", error);
|
||||||
}
|
|
||||||
return None
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
None
|
||||||
|
} else {
|
||||||
Some(tera)
|
Some(tera)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn render<C: Serialize>(&self, name: &str, context: C) -> Option<String> {
|
fn render<C: Serialize>(&self, name: &str, context: C) -> Option<String> {
|
||||||
if self.get_template(name).is_err() {
|
if self.get_template(name).is_err() {
|
||||||
|
|
Loading…
Reference in New Issue