summaryrefslogtreecommitdiff
path: root/src/eval/template.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-15 16:59:49 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-15 17:06:43 +0100
commit63c274e7f6aa3a8c3f43abb91935ec924a186f73 (patch)
tree193777ff773c6b547c6ef828ddf9750694fae7bc /src/eval/template.rs
parent8a38899c98b4f9829b2d1f21c8fee66d254d20c6 (diff)
Make clippy happier and remove `Str`
Diffstat (limited to 'src/eval/template.rs')
-rw-r--r--src/eval/template.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/eval/template.rs b/src/eval/template.rs
index 2622a1f0..18104638 100644
--- a/src/eval/template.rs
+++ b/src/eval/template.rs
@@ -5,7 +5,6 @@ use std::mem;
use std::ops::{Add, AddAssign};
use std::rc::Rc;
-use super::Str;
use crate::diag::StrResult;
use crate::geom::{Align, Dir, GenAxis, Length, Linear, Sides, Size};
use crate::layout::{BlockLevel, BlockNode, InlineLevel, InlineNode, PageNode};
@@ -214,20 +213,20 @@ impl AddAssign for Template {
}
}
-impl Add<Str> for Template {
+impl Add<EcoString> for Template {
type Output = Self;
- fn add(mut self, rhs: Str) -> Self::Output {
- Rc::make_mut(&mut self.0).push(TemplateNode::Text(rhs.into()));
+ fn add(mut self, rhs: EcoString) -> Self::Output {
+ Rc::make_mut(&mut self.0).push(TemplateNode::Text(rhs));
self
}
}
-impl Add<Template> for Str {
+impl Add<Template> for EcoString {
type Output = Template;
fn add(self, mut rhs: Template) -> Self::Output {
- Rc::make_mut(&mut rhs.0).insert(0, TemplateNode::Text(self.into()));
+ Rc::make_mut(&mut rhs.0).insert(0, TemplateNode::Text(self));
rhs
}
}
@@ -491,7 +490,7 @@ impl ParBuilder {
self.children.last_mut()
{
if prev_align == curr_align && Rc::ptr_eq(prev_props, curr_props) {
- prev_text.push_str(&curr_text);
+ prev_text.push_str(curr_text);
return;
}
}