From b305b3c693474e5b1d5bfea74e745e916346586f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 6 Apr 2016 14:40:36 +0200 Subject: [PATCH] Implement Edit for String --- libimagrt/src/edit.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libimagrt/src/edit.rs b/libimagrt/src/edit.rs index fb38bc54..93fa1a6b 100644 --- a/libimagrt/src/edit.rs +++ b/libimagrt/src/edit.rs @@ -13,6 +13,14 @@ pub trait Edit { 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 { fn edit_content(&mut self, rt: &Runtime) -> EditResult<()> {