summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-11-04 11:34:58 +0100
committerGitHub <noreply@github.com>2016-11-04 11:34:58 +0100
commit1db063f3343ccb8d7a2ea2f1c3acf8eb24d39162 (patch)
treea0da80bf4f4f26c48101ed07077457020f775444
parente70fdc63c8f566039cf3f1afa910fa1a47430415 (diff)
parentc02d7693b24a37c6bc02beccefe1803e34adbac2 (diff)
downloadimag-1db063f3343ccb8d7a2ea2f1c3acf8eb24d39162.zip
imag-1db063f3343ccb8d7a2ea2f1c3acf8eb24d39162.tar.gz
Merge pull request #834 from Stebalien/master
Don't re-open temporary file.
-rw-r--r--libimagutil/src/edit.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/libimagutil/src/edit.rs b/libimagutil/src/edit.rs
index 3cf459f..5d1838f 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<bool, IOError> {
- 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());