Implement Edit for String

This commit is contained in:
Matthias Beyer 2016-04-06 14:40:36 +02:00
parent b30cde474d
commit b305b3c693

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<()> {