Merge pull request #1215 from ehuss/block-cleanup
Remove some unnecessary blocks.
This commit is contained in:
commit
e8d4bc52e1
|
@ -57,20 +57,16 @@ impl HtmlHandlebars {
|
|||
bail!(ErrorKind::ReservedFilenameError(path.clone()));
|
||||
};
|
||||
|
||||
// Non-lexical lifetimes needed :'(
|
||||
let title: String;
|
||||
{
|
||||
let book_title = ctx
|
||||
.data
|
||||
.get("book_title")
|
||||
.and_then(serde_json::Value::as_str)
|
||||
.unwrap_or("");
|
||||
|
||||
title = match book_title {
|
||||
let title = match book_title {
|
||||
"" => ch.name.clone(),
|
||||
_ => ch.name.clone() + " - " + book_title,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ctx.data.insert("path".to_owned(), json!(path));
|
||||
ctx.data.insert("content".to_owned(), json!(content));
|
||||
|
|
|
@ -204,7 +204,6 @@ impl Renderer for CmdRenderer {
|
|||
Err(e) => return self.handle_render_command_error(ctx, e),
|
||||
};
|
||||
|
||||
{
|
||||
let mut stdin = child.stdin.take().expect("Child has stdin");
|
||||
if let Err(e) = serde_json::to_writer(&mut stdin, &ctx) {
|
||||
// Looks like the backend hung up before we could finish
|
||||
|
@ -214,7 +213,6 @@ impl Renderer for CmdRenderer {
|
|||
|
||||
// explicitly close the `stdin` file handle
|
||||
drop(stdin);
|
||||
}
|
||||
|
||||
let status = child
|
||||
.wait()
|
||||
|
|
Loading…
Reference in New Issue