diff --git a/src/utils.rs b/src/utils.rs index 98e381c5..234ad303 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -395,7 +395,13 @@ impl Add for &ImmutableString { impl AddAssign for ImmutableString { #[inline(always)] fn add_assign(&mut self, rhs: String) { - self.make_mut().push_str(&rhs); + if !rhs.is_empty() { + if self.is_empty() { + self.0 = Into::::into(rhs).into(); + } else { + self.make_mut().push_str(&rhs); + } + } } }