Skip to content

Commit

Permalink
fixed lints
Browse files Browse the repository at this point in the history
  • Loading branch information
blandger committed Jul 22, 2024
1 parent ce14da1 commit 10021d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ impl<'a> Generator<'a> {
renderer.preprocess_chapter(&self.preprocess_ctx, ch)?;
}
trace!("{}", &ch.content);
let rendered_result = self.render_chapter(&ch);
let rendered: String;
let rendered_result = self.render_chapter(ch);

// let's skip chapter without content (drafts)
match rendered_result {
let rendered: String = match rendered_result {
Ok(rendered_content) => {
rendered = rendered_content;
rendered_content
}
Err(error_msg) => {
warn!(
Expand All @@ -172,7 +172,7 @@ impl<'a> Generator<'a> {
);
return Ok(());
}
}
};

let content_path = ch.path.as_ref().ok_or_else(|| {
Error::ContentFileNotFound(format!(
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ pub fn generate(
pub fn output_filename(dest: &Path, config: &MdConfig) -> PathBuf {
match config.book.title {
Some(ref title) => {
let out_file_name;
if config.book.language.is_some() && config.book.version.is_some() {
out_file_name = format!(

let out_file_name = if config.book.language.is_some() && config.book.version.is_some() {
format!(
"{}-{}-{}.zip",
title,
config.book.language.as_ref().unwrap(),
config.book.version.as_ref().unwrap()
);
)
} else {
out_file_name = title.to_string();
}
title.to_string()
};
debug!("Composed file name = {}", &out_file_name);
dest.join(out_file_name).with_extension("epub")
}
Expand Down

0 comments on commit 10021d3

Please # to comment.