use crate::CowStr;
use super::MagicString;
impl<'text> MagicString<'text> {
pub fn append(&mut self, source: impl Into<CowStr<'text>>) -> &mut Self {
self.append_outro(source.into());
self
}
pub fn append_left(&mut self, text_index: usize, content: impl Into<CowStr<'text>>) -> &mut Self {
match self.by_end_mut(text_index) {
Some(chunk) => {
chunk.append_outro(content.into());
}
None => self.append_intro(content.into()),
}
self
}
pub fn append_right(
&mut self,
text_index: usize,
content: impl Into<CowStr<'text>>,
) -> &mut Self {
match self.by_start_mut(text_index) {
Some(chunk) => {
chunk.append_intro(content.into());
}
None => self.append_outro(content.into()),
}
self
}
}