summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorapatniv <apatniv@gmail.com>2020-12-31 15:37:34 -0500
committerapatniv <apatniv@gmail.com>2020-12-31 15:37:34 -0500
commit95e0743bc0c66f74bbd2bf21b77b6ad8ec60c0f2 (patch)
tree411b8971517b06071469b5036fbfb6f2d11829a0 /src
parenta64a7b747080dc3cbc9d57aab36d83e609444020 (diff)
clippy: use char instead of str
Diffstat (limited to 'src')
-rw-r--r--src/renderer/html_handlebars/hbs_renderer.rs6
-rw-r--r--src/utils/string.rs6
-rw-r--r--src/utils/toml_ext.rs2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs
index 6ac5985b..6b934b13 100644
--- a/src/renderer/html_handlebars/hbs_renderer.rs
+++ b/src/renderer/html_handlebars/hbs_renderer.rs
@@ -366,7 +366,7 @@ impl HtmlHandlebars {
// Note: all paths are relative to the build directory, so the
// leading slash in an absolute path means nothing (and would mess
// up `root.join(original)`).
- let original = original.trim_start_matches("/");
+ let original = original.trim_start_matches('/');
let filename = root.join(original);
self.emit_redirect(handlebars, &filename, new)?;
}
@@ -899,10 +899,10 @@ fn partition_source(s: &str) -> (String, String) {
if !header || after_header {
after_header = true;
after.push_str(line);
- after.push_str("\n");
+ after.push('\n');
} else {
before.push_str(line);
- before.push_str("\n");
+ before.push('\n');
}
}
diff --git a/src/utils/string.rs b/src/utils/string.rs
index 1151d1e8..59931743 100644
--- a/src/utils/string.rs
+++ b/src/utils/string.rs
@@ -70,7 +70,7 @@ pub fn take_rustdoc_include_lines<R: RangeBounds<usize>>(s: &str, range: R) -> S
output.push_str("# ");
}
output.push_str(line);
- output.push_str("\n");
+ output.push('\n');
}
output.pop();
output
@@ -95,7 +95,7 @@ pub fn take_rustdoc_include_anchored_lines(s: &str, anchor: &str) -> String {
None => {
if !ANCHOR_START.is_match(l) {
output.push_str(l);
- output.push_str("\n");
+ output.push('\n');
}
}
}
@@ -106,7 +106,7 @@ pub fn take_rustdoc_include_anchored_lines(s: &str, anchor: &str) -> String {
} else if !ANCHOR_END.is_match(l) {
output.push_str("# ");
output.push_str(l);
- output.push_str("\n");
+ output.push('\n');
}
}
diff --git a/src/utils/toml_ext.rs b/src/utils/toml_ext.rs
index 908ab2db..bf25ad11 100644
--- a/src/utils/toml_ext.rs
+++ b/src/utils/toml_ext.rs
@@ -53,7 +53,7 @@ impl TomlExt for Value {
}
fn split(key: &str) -> Option<(&str, &str)> {
- let ix = key.find(".")?;
+ let ix = key.find('.')?;
let (head, tail) = key.split_at(ix);
// splitting will leave the "."