minor refactor
This commit is contained in:
parent
cdc0c02e37
commit
92a201981a
1 changed files with 2 additions and 4 deletions
|
@ -92,8 +92,7 @@ pub fn build(targets: &Vec<Map<String, Value>>, template_dir: String, config: &C
|
||||||
|
|
||||||
let content = read_to_string(path).unwrap();
|
let content = read_to_string(path).unwrap();
|
||||||
let template = engine.compile(&content);
|
let template = engine.compile(&content);
|
||||||
if template.is_err() {
|
if let Err(error) = template {
|
||||||
let error = template.err().unwrap();
|
|
||||||
println!(" {BOLD}{FAILURE}failed to compile template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
println!(" {BOLD}{FAILURE}failed to compile template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -101,8 +100,7 @@ pub fn build(targets: &Vec<Map<String, Value>>, template_dir: String, config: &C
|
||||||
// render
|
// render
|
||||||
println!(" {ITALIC}rendering{RESET}");
|
println!(" {ITALIC}rendering{RESET}");
|
||||||
let render = template.unwrap().render(&context).to_string();
|
let render = template.unwrap().render(&context).to_string();
|
||||||
if render.is_err() {
|
if let Err(error) = render {
|
||||||
let error = render.err().unwrap();
|
|
||||||
println!(" {BOLD}{FAILURE}failed to render template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
println!(" {BOLD}{FAILURE}failed to render template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue