From 15e801e1a242e1b0263fe854e6c9d58a68774dd0 Mon Sep 17 00:00:00 2001 From: Artur Kovacs Date: Fri, 12 Jul 2019 22:49:58 -0700 Subject: [PATCH] Fix Windows compile error. --- src/windows.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/windows.rs b/src/windows.rs index 604dd83..7c8a40a 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -31,10 +31,9 @@ where .map_err(|e| Error::CanonicalizePath { code: e.raw_os_error(), })?; - let mut from = OsString::new(); let mut wide_paths = Vec::with_capacity(full_paths.len()); for path in full_paths.iter() { - let mut os_string = OsString::from(canonical); + let mut os_string = OsString::from(path); os_string.push("\0"); let mut encode_wide = os_string.as_os_str().encode_wide(); // Remove the "\\?\" prefix as `SHFileOperationW` fails if such a prefix is part of the path.