diff --git a/lib/etc/libimagutil/Cargo.toml b/lib/etc/libimagutil/Cargo.toml index fa4f7574..17e979fa 100644 --- a/lib/etc/libimagutil/Cargo.toml +++ b/lib/etc/libimagutil/Cargo.toml @@ -30,7 +30,7 @@ url = "1.5" boolinator = "2.4.0" lazy_static = "1" log = "0.4.0" -regex = "0.2" -tempfile = "2.1" +regex = "1" +tempfile = "3" chrono = "0.4" diff --git a/lib/etc/libimagutil/src/edit.rs b/lib/etc/libimagutil/src/edit.rs index 17ad347c..4a91c798 100644 --- a/lib/etc/libimagutil/src/edit.rs +++ b/lib/etc/libimagutil/src/edit.rs @@ -31,7 +31,7 @@ pub fn edit_in_tmpfile_with_command(mut cmd: Command, s: &mut String) -> Result< let file_path = file.path(); file.write_all(&s.clone().into_bytes()[..])?; - file.sync_data()?; + file.as_file().sync_data()?; debug!("Calling {:?} for {}", cmd, file_path.display()); @@ -39,7 +39,8 @@ pub fn edit_in_tmpfile_with_command(mut cmd: Command, s: &mut String) -> Result< .status() .and_then(|status| { if status.success() { - file.sync_data() + file.as_file() + .sync_data() .and_then(|_| file.seek(SeekFrom::Start(0))) .and_then(|_| { let mut new_s = String::new();