1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub(crate) trait StringExt { fn push_string(&mut self, string: String); fn push_newline(&mut self); } impl StringExt for String { fn push_newline(&mut self) { self.push('\n'); } fn push_string(&mut self, string: String) { self.push_str(&string); } }