use std::mem;
use arcstr::Substr;
pub trait SubStrExt {
fn append(&mut self, tail: Self);
}
impl SubStrExt for Substr {
fn append(&mut self, tail: Self) {
if self.is_empty() {
*self = tail
} else {
let mut owned = mem::take(self).to_string();
owned.push_str(&tail);
*self = Substr::from(owned)
}
}
}
pub const EMPTY_SUBSTR: Substr = arcstr::literal_substr!("");