Skip to content

Commit fbc2159

Browse files
committed
Some clippy cleanup
1 parent e7b6911 commit fbc2159

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/renderer/html_handlebars/static_files.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ impl StaticFiles {
5454
}
5555
this.add_builtin("css/variables.css", &theme.variables_css);
5656
if let Some(contents) = &theme.favicon_png {
57-
this.add_builtin("favicon.png", &contents);
57+
this.add_builtin("favicon.png", contents);
5858
}
5959
if let Some(contents) = &theme.favicon_svg {
60-
this.add_builtin("favicon.svg", &contents);
60+
this.add_builtin("favicon.svg", contents);
6161
}
6262
this.add_builtin("highlight.css", &theme.highlight_css);
6363
this.add_builtin("tomorrow-night.css", &theme.tomorrow_night_css);
@@ -131,8 +131,8 @@ impl StaticFiles {
131131
.iter()
132132
.chain(html_config.additional_js.iter());
133133

134-
for custom_file in custom_files.cloned() {
135-
let input_location = root.join(&custom_file);
134+
for custom_file in custom_files {
135+
let input_location = root.join(custom_file);
136136

137137
this.static_files.push(StaticFile::Additional {
138138
input_location,
@@ -245,8 +245,8 @@ impl StaticFiles {
245245
.expect("capture 1 in resource regex")
246246
.as_bytes();
247247
let name = std::str::from_utf8(name).expect("resource name with invalid utf8");
248-
let resource_filename = hash_map.get(name).map(|s| &s[..]).unwrap_or(&name);
249-
let path_to_root = utils::fs::path_to_root(&filename);
248+
let resource_filename = hash_map.get(name).map(|s| &s[..]).unwrap_or(name);
249+
let path_to_root = utils::fs::path_to_root(filename);
250250
format!("{}{}", path_to_root, resource_filename)
251251
.as_bytes()
252252
.to_owned()
@@ -261,7 +261,7 @@ impl StaticFiles {
261261
} else {
262262
Cow::Borrowed(&data[..])
263263
};
264-
write_file(destination, &filename, &data)?;
264+
write_file(destination, filename, &data)?;
265265
}
266266
StaticFile::Additional {
267267
ref input_location,
@@ -284,7 +284,7 @@ impl StaticFiles {
284284
let data = replace_all(&self.hash_map, &data, filename);
285285
write_file(destination, filename, &data)?;
286286
} else {
287-
fs::copy(&input_location, &output_location).with_context(|| {
287+
fs::copy(input_location, &output_location).with_context(|| {
288288
format!(
289289
"Unable to copy {} to {}",
290290
input_location.display(),

0 commit comments

Comments
 (0)