summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-11-21 08:15:29 +0200
committerLars Wirzenius <liw@liw.fi>2020-11-21 08:43:56 +0200
commit1580169cae459b8d555e103c72a764929930ba30 (patch)
tree0a5c11fdddafb948fbbac48bb05b87c7e02ba207
parent5e8fc5b2c0b1e42cfda4c28ea839f422e6c170d5 (diff)
downloadsubplot-1580169cae459b8d555e103c72a764929930ba30.tar.gz
chore(src/visitor/structure.rs): push a char instead of push_str
Doesn't change the result, but it's cleaner to push a character instead of push_str a single-character string.
-rw-r--r--src/metadata.rs6
-rw-r--r--src/steps.rs2
-rw-r--r--src/visitor/structure.rs6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/metadata.rs b/src/metadata.rs
index 05f686b..85c1576 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -235,9 +235,9 @@ fn join_into_buffer(vec: &[Inline], buf: &mut String) {
pandoc_ast::Inline::Superscript(v) => join_into_buffer(v, buf),
pandoc_ast::Inline::Subscript(v) => join_into_buffer(v, buf),
pandoc_ast::Inline::SmallCaps(v) => join_into_buffer(v, buf),
- pandoc_ast::Inline::Space => buf.push_str(" "),
- pandoc_ast::Inline::SoftBreak => buf.push_str(" "),
- pandoc_ast::Inline::LineBreak => buf.push_str(" "),
+ pandoc_ast::Inline::Space => buf.push(' '),
+ pandoc_ast::Inline::SoftBreak => buf.push(' '),
+ pandoc_ast::Inline::LineBreak => buf.push(' '),
_ => panic!("unknown pandoc_ast::Inline component {:?}", item),
}
}
diff --git a/src/steps.rs b/src/steps.rs
index 9af526c..c8c1bf6 100644
--- a/src/steps.rs
+++ b/src/steps.rs
@@ -67,7 +67,7 @@ impl ScenarioStep {
let mut joined = String::new();
for word in words {
joined.push_str(word);
- joined.push_str(" ");
+ joined.push(' ');
}
if joined.len() > 1 {
joined.pop();
diff --git a/src/visitor/structure.rs b/src/visitor/structure.rs
index 725ffd2..735bae2 100644
--- a/src/visitor/structure.rs
+++ b/src/visitor/structure.rs
@@ -84,9 +84,9 @@ fn join_into_buffer(vec: &[Inline], buf: &mut String) {
}
Inline::Cite(_, v) => join_into_buffer(v, buf),
Inline::Code(_attr, s) => buf.push_str(s),
- Inline::Space => buf.push_str(" "),
- Inline::SoftBreak => buf.push_str(" "),
- Inline::LineBreak => buf.push_str(" "),
+ Inline::Space => buf.push(' '),
+ Inline::SoftBreak => buf.push(' '),
+ Inline::LineBreak => buf.push(' '),
Inline::Math(_, s) => buf.push_str(s),
Inline::RawInline(_, s) => buf.push_str(s),
Inline::Link(_, v, _) => join_into_buffer(v, buf),