diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-10 13:07:39 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-10 13:07:39 +0200 |
| commit | 36b3067c19c8743032a44f888ee48702b88d135b (patch) | |
| tree | 89893f4501109b35bb6498b93bda4f3cc82dba40 /src/exec/context.rs | |
| parent | 9950627789358b4d46c7fd8ba20d1428aee7bf01 (diff) | |
Eco string 🌱
Diffstat (limited to 'src/exec/context.rs')
| -rw-r--r-- | src/exec/context.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/exec/context.rs b/src/exec/context.rs index 0f6d47f5..4764a808 100644 --- a/src/exec/context.rs +++ b/src/exec/context.rs @@ -3,6 +3,7 @@ use std::rc::Rc; use super::{Exec, ExecWithMap, FontFamily, State}; use crate::diag::{Diag, DiagSet, Pass}; +use crate::eco::EcoString; use crate::eval::{ExprMap, TemplateValue}; use crate::geom::{Align, Dir, Gen, GenAxis, Length, Linear, Sides, Size}; use crate::layout::{ @@ -77,7 +78,7 @@ impl ExecContext { /// Push text into the active paragraph. /// /// The text is split into lines at newlines. - pub fn push_text(&mut self, text: impl Into<String>) { + pub fn push_text(&mut self, text: impl Into<EcoString>) { self.stack.par.push(self.make_text_node(text)); } @@ -143,7 +144,7 @@ impl ExecContext { Pass::new(self.tree, self.diags) } - fn make_text_node(&self, text: impl Into<String>) -> ParChild { + fn make_text_node(&self, text: impl Into<EcoString>) -> ParChild { ParChild::Text( text.into(), self.state.aligns.cross, |
