use std::{borrow::Cow, ops::Add};
use crate::JustString;
impl<'x> Add<&'x str> for JustString<'x> {
type Output = Self;
fn add(self, rhs: &'x str) -> Self::Output {
match self {
Self::RefStr(s) => Self::CowStr(Cow::Borrowed(s) + rhs),
Self::RefString(s) => Self::String(s.clone() + rhs),
Self::CowStr(s) => Self::CowStr(s + rhs),
Self::String(s) => Self::String(s + rhs),
Self::BoxStr(s) => Self::BoxStr((s.to_string() + rhs).into_boxed_str()),
}
}
}