SHE LIVES!
This commit is contained in:
@@ -30,4 +30,25 @@ impl DummyOutput {
|
||||
out : String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub struct StringFillerOutput<'s> {
|
||||
string : &'s mut String
|
||||
}
|
||||
|
||||
|
||||
impl<'s> Output for StringFillerOutput<'s> {
|
||||
fn write(&mut self, data : &str) {
|
||||
*self.string += data;
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> StringFillerOutput<'a> {
|
||||
pub fn new(string : &'a mut String) -> StringFillerOutput<'a> {
|
||||
// TODO: reserve() to make this faster than dummyoutput
|
||||
StringFillerOutput {
|
||||
string
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user