Skip to content

Commit 87d2cd9

Browse files
authored
Merge pull request #1421 from apatniv/clippy_use_single_char
clippy: use char instead of str
2 parents 32abeef + 95e0743 commit 87d2cd9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ impl HtmlHandlebars {
366366
// Note: all paths are relative to the build directory, so the
367367
// leading slash in an absolute path means nothing (and would mess
368368
// up `root.join(original)`).
369-
let original = original.trim_start_matches("/");
369+
let original = original.trim_start_matches('/');
370370
let filename = root.join(original);
371371
self.emit_redirect(handlebars, &filename, new)?;
372372
}
@@ -899,10 +899,10 @@ fn partition_source(s: &str) -> (String, String) {
899899
if !header || after_header {
900900
after_header = true;
901901
after.push_str(line);
902-
after.push_str("\n");
902+
after.push('\n');
903903
} else {
904904
before.push_str(line);
905-
before.push_str("\n");
905+
before.push('\n');
906906
}
907907
}
908908

src/utils/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn take_rustdoc_include_lines<R: RangeBounds<usize>>(s: &str, range: R) -> S
7070
output.push_str("# ");
7171
}
7272
output.push_str(line);
73-
output.push_str("\n");
73+
output.push('\n');
7474
}
7575
output.pop();
7676
output
@@ -95,7 +95,7 @@ pub fn take_rustdoc_include_anchored_lines(s: &str, anchor: &str) -> String {
9595
None => {
9696
if !ANCHOR_START.is_match(l) {
9797
output.push_str(l);
98-
output.push_str("\n");
98+
output.push('\n');
9999
}
100100
}
101101
}
@@ -106,7 +106,7 @@ pub fn take_rustdoc_include_anchored_lines(s: &str, anchor: &str) -> String {
106106
} else if !ANCHOR_END.is_match(l) {
107107
output.push_str("# ");
108108
output.push_str(l);
109-
output.push_str("\n");
109+
output.push('\n');
110110
}
111111
}
112112

src/utils/toml_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl TomlExt for Value {
5353
}
5454

5555
fn split(key: &str) -> Option<(&str, &str)> {
56-
let ix = key.find(".")?;
56+
let ix = key.find('.')?;
5757

5858
let (head, tail) = key.split_at(ix);
5959
// splitting will leave the "."

0 commit comments

Comments
 (0)