]> git.proxmox.com Git - proxmox.git/commitdiff
tools: replace_file, make options not an option...
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 18 Dec 2019 09:04:21 +0000 (10:04 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 18 Dec 2019 09:04:22 +0000 (10:04 +0100)
CreateOptions::new() creates an all-None option set anyway

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-tools/src/fs.rs

index 67f0f9c10abb1aaeed9b0951f0f8a8cd8817fa9f..9fd46cb5c30671e99f1ba15f96a9fc6e18b5e2e0 100644 (file)
@@ -74,9 +74,8 @@ pub fn file_read_firstline<P: AsRef<Path>>(path: P) -> Result<String, Error> {
 pub fn replace_file<P: AsRef<Path>>(
     path: P,
     data: &[u8],
-    options: Option<CreateOptions>,
+    options: CreateOptions,
 ) -> Result<(), Error> {
-    let options = options.unwrap_or_default();
     file_set_contents_full(
         path.as_ref(),
         data,