summaryrefslogtreecommitdiff
path: root/src/pretty.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-12 23:11:47 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-12 23:11:47 +0100
commit094462cbdda15f19d2dc071b18201f656b8ddcd4 (patch)
tree0994b286aa1718cbc1a0b9523a934c1fb3f6f755 /src/pretty.rs
parent58f799c41cb71f167e6e82eb94b3cde1303de11e (diff)
Make templates and strings summable 🥪
Diffstat (limited to 'src/pretty.rs')
-rw-r--r--src/pretty.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pretty.rs b/src/pretty.rs
index 2e16a914..41fd6d78 100644
--- a/src/pretty.rs
+++ b/src/pretty.rs
@@ -120,7 +120,7 @@ impl PrettyWithMap for Node {
Self::Linebreak => p.push_str(r"\"),
Self::Parbreak => p.push_str("\n\n"),
// TODO: Handle escaping.
- Self::Text(text) => p.push_str(&text),
+ Self::Text(text) => p.push_str(text),
Self::Heading(heading) => heading.pretty_with_map(p, map),
Self::Raw(raw) => raw.pretty(p),
Self::Expr(expr) => {
@@ -538,6 +538,7 @@ impl Pretty for TemplateNode {
fn pretty(&self, p: &mut Printer) {
match self {
Self::Tree { tree, map } => tree.pretty_with_map(p, Some(map)),
+ Self::Str(s) => p.push_str(s),
Self::Any(any) => any.pretty(p),
}
}