summaryrefslogtreecommitdiff
path: root/src/exec/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-21 11:43:25 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-21 11:43:25 +0100
commitde37a056ed3e90d8ba93c4b3a315a8046ef53484 (patch)
tree35701a2b79fe968a9b613cfbf77bc1198046d7b2 /src/exec/mod.rs
parent4d42c79b169063f6c8e7603db6777d0e60ff2e0b (diff)
Split pushed text at newlines ✂
Diffstat (limited to 'src/exec/mod.rs')
-rw-r--r--src/exec/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/exec/mod.rs b/src/exec/mod.rs
index 37c03cda..ea2c90f4 100644
--- a/src/exec/mod.rs
+++ b/src/exec/mod.rs
@@ -139,17 +139,17 @@ impl Exec for Value {
fn exec(&self, ctx: &mut ExecContext) {
match self {
Value::None => {}
- Value::Int(v) => ctx.push_text(pretty(v)),
- Value::Float(v) => ctx.push_text(pretty(v)),
- Value::Str(s) => ctx.push_text(s),
- Value::Template(template) => template.exec(ctx),
+ Value::Int(v) => ctx.push_text(&pretty(v)),
+ Value::Float(v) => ctx.push_text(&pretty(v)),
+ Value::Str(v) => ctx.push_text(v),
+ Value::Template(v) => v.exec(ctx),
Value::Error => {}
other => {
// For values which can't be shown "naturally", we print
// the representation in monospace.
let prev = Rc::clone(&ctx.state.font.families);
ctx.apply_monospace();
- ctx.push_text(pretty(other));
+ ctx.push_text(&pretty(other));
ctx.state.font.families = prev;
}
}
@@ -168,8 +168,8 @@ impl Exec for TemplateNode {
fn exec(&self, ctx: &mut ExecContext) {
match self {
Self::Tree { tree, map } => tree.exec_with_map(ctx, &map),
- Self::Str(s) => ctx.push_text(s),
- Self::Func(func) => func.exec(ctx),
+ Self::Str(v) => ctx.push_text(v),
+ Self::Func(v) => v.exec(ctx),
}
}
}