summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-07-29 12:01:06 +0200
committerLaurenz <laurmaedje@gmail.com>2021-07-29 12:01:06 +0200
commit853361338bd756c23992041511b1836a2cd0647f (patch)
tree335e632ed0de6090d3139b5f39d02d03ba471bad /src/util
parent312dcd070cf79c1dd5503f90ef10588fe4612108 (diff)
Better addition and iteration for array, dict and template
Diffstat (limited to 'src/util')
-rw-r--r--src/util/eco.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/eco.rs b/src/util/eco.rs
index a52a163c..7fe1ac9c 100644
--- a/src/util/eco.rs
+++ b/src/util/eco.rs
@@ -274,14 +274,20 @@ impl PartialOrd for EcoString {
}
}
-impl Add<&Self> for EcoString {
+impl Add for EcoString {
type Output = Self;
- fn add(self, rhs: &Self) -> Self::Output {
+ fn add(self, rhs: Self) -> Self::Output {
self + rhs.as_str()
}
}
+impl AddAssign for EcoString {
+ fn add_assign(&mut self, rhs: EcoString) {
+ self.push_str(&rhs);
+ }
+}
+
impl Add<&str> for EcoString {
type Output = Self;