]> git.proxmox.com Git - cargo.git/blobdiff - vendor/tempfile/src/file/imp/windows.rs
New upstream version 0.37.0
[cargo.git] / vendor / tempfile / src / file / imp / windows.rs
index 3b35f5c72fbc71fb41abe2b3b8fa70c1edd9a8d6..71b4748802a38566c2cd4f3307712ad0f8c8deab 100644 (file)
@@ -14,14 +14,14 @@ use winapi::um::winnt::{FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_TEMPORARY};
 use winapi::um::winnt::{FILE_GENERIC_READ, FILE_GENERIC_WRITE, HANDLE};
 use winapi::um::winnt::{FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE};
 
-use util;
+use crate::util;
 
 fn to_utf16(s: &Path) -> Vec<u16> {
     s.as_os_str().encode_wide().chain(iter::once(0)).collect()
 }
 
-pub fn create_named(path: &Path) -> io::Result<File> {
-    OpenOptions::new()
+pub fn create_named(path: &Path, open_options: &mut OpenOptions) -> io::Result<File> {
+    open_options
         .create_new(true)
         .read(true)
         .write(true)
@@ -34,7 +34,7 @@ pub fn create(dir: &Path) -> io::Result<File> {
         dir,
         OsStr::new(".tmp"),
         OsStr::new(""),
-        ::NUM_RAND_CHARS,
+        crate::NUM_RAND_CHARS,
         |path| {
             OpenOptions::new()
                 .create_new(true)