Merge pull request #323 from matthiasbeyer/libimagrt/edit-for-string

Implement Edit for String
This commit is contained in:
Matthias Beyer 2016-04-06 15:06:07 +02:00
commit db82a121c4

View file

@ -13,6 +13,14 @@ pub trait Edit {
fn edit_content(&mut self, rt: &Runtime) -> EditResult<()>; fn edit_content(&mut self, rt: &Runtime) -> EditResult<()>;
} }
impl Edit for String {
fn edit_content(&mut self, rt: &Runtime) -> EditResult<()> {
edit_in_tmpfile(rt, self).map(|_| ())
}
}
impl Edit for Entry { impl Edit for Entry {
fn edit_content(&mut self, rt: &Runtime) -> EditResult<()> { fn edit_content(&mut self, rt: &Runtime) -> EditResult<()> {