Skip to content

Commit 8f6523a

Browse files
committed
Fix some clippy warnings
1 parent 382fc41 commit 8f6523a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/bin/watch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ where
7373
Ok(w) => w,
7474
Err(e) => {
7575
println!("Error while trying to watch the files:\n\n\t{:?}", e);
76-
::std::process::exit(0);
76+
::std::process::exit(0)
7777
}
7878
};
7979

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl HtmlHandlebars {
7979
let filepath = Path::new(&ch.path).with_extension("html");
8080
let rendered = self.post_process(
8181
rendered,
82-
&normalize_path(filepath.to_str().ok_or(Error::from(
82+
&normalize_path(filepath.to_str().ok_or_else(|| Error::from(
8383
format!("Bad file name: {}", filepath.display()),
8484
))?),
8585
ctx.book.get_html_config().get_playpen_config(),
@@ -129,8 +129,8 @@ impl HtmlHandlebars {
129129
filepath: &str,
130130
playpen_config: &PlaypenConfig)
131131
-> String {
132-
let rendered = build_header_links(&rendered, &filepath);
133-
let rendered = fix_anchor_links(&rendered, &filepath);
132+
let rendered = build_header_links(&rendered, filepath);
133+
let rendered = fix_anchor_links(&rendered, filepath);
134134
let rendered = fix_code_blocks(&rendered);
135135
let rendered = add_playpen_pre(&rendered, playpen_config);
136136

@@ -470,7 +470,7 @@ fn id_from_content(content: &str) -> String {
470470
}
471471

472472
// Remove spaces and hastags indicating a header
473-
let trimmed = content.trim().trim_left_matches("#").trim();
473+
let trimmed = content.trim().trim_left_matches('#').trim();
474474

475475
normalize_id(trimmed)
476476
}

0 commit comments

Comments
 (0)