diff --git a/libimagutil/src/edit.rs b/libimagutil/src/edit.rs index 3cf459f4..5d1838fc 100644 --- a/libimagutil/src/edit.rs +++ b/libimagutil/src/edit.rs @@ -27,9 +27,8 @@ use std::io::Error as IOError; use tempfile::NamedTempFile; pub fn edit_in_tmpfile_with_command(mut cmd: Command, s: &mut String) -> Result { - let file = try!(NamedTempFile::new()); + let mut file = &try!(NamedTempFile::new()); let file_path = file.path(); - let mut file = try!(file.reopen()); try!(file.write_all(&s.clone().into_bytes()[..])); try!(file.sync_data());