Skip to content

Commit

Permalink
Merge pull request rust-lang#1145 from Rosto75/master
Browse files Browse the repository at this point in the history
Add a case for an empty `book_title` parameter
  • Loading branch information
ehuss committed Feb 16, 2020
2 parents 399b883 + 9ed83a7 commit 6de3e22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ impl HtmlHandlebars {
.get("book_title")
.and_then(serde_json::Value::as_str)
.unwrap_or("");
title = ch.name.clone() + " - " + book_title;

title = match book_title {
"" => ch.name.clone(),
_ => ch.name.clone() + " - " + book_title,
}
}

ctx.data.insert("path".to_owned(), json!(path));
Expand Down

0 comments on commit 6de3e22

Please sign in to comment.