@@ -26,7 +26,7 @@ macro_rules! call {
2626}
2727
2828#[ cfg( target_os = "windows" ) ]
29- fn path_to_windows_str < T : AsRef < OsStr > > ( path : T ) -> Vec < u16 > {
29+ fn path_to_windows_str < T : AsRef < OsStr > > ( path : & T ) -> Vec < u16 > {
3030 path. as_ref ( ) . encode_wide ( ) . chain ( Some ( 0 ) ) . collect ( )
3131}
3232
@@ -164,8 +164,8 @@ impl KVStore for FilesystemStore {
164164 let res = if dest_file_path. exists ( ) {
165165 call ! ( unsafe {
166166 windows_sys:: Win32 :: Storage :: FileSystem :: ReplaceFileW (
167- path_to_windows_str( dest_file_path. clone ( ) ) . as_ptr( ) ,
168- path_to_windows_str( tmp_file_path) . as_ptr( ) ,
167+ path_to_windows_str( & dest_file_path) . as_ptr( ) ,
168+ path_to_windows_str( & tmp_file_path) . as_ptr( ) ,
169169 std:: ptr:: null( ) ,
170170 windows_sys:: Win32 :: Storage :: FileSystem :: REPLACEFILE_IGNORE_MERGE_ERRORS ,
171171 std:: ptr:: null_mut( ) as * const core:: ffi:: c_void,
@@ -175,8 +175,8 @@ impl KVStore for FilesystemStore {
175175 } else {
176176 call ! ( unsafe {
177177 windows_sys:: Win32 :: Storage :: FileSystem :: MoveFileExW (
178- path_to_windows_str( tmp_file_path) . as_ptr( ) ,
179- path_to_windows_str( dest_file_path. clone ( ) ) . as_ptr( ) ,
178+ path_to_windows_str( & tmp_file_path) . as_ptr( ) ,
179+ path_to_windows_str( & dest_file_path) . as_ptr( ) ,
180180 windows_sys:: Win32 :: Storage :: FileSystem :: MOVEFILE_WRITE_THROUGH
181181 | windows_sys:: Win32 :: Storage :: FileSystem :: MOVEFILE_REPLACE_EXISTING ,
182182 )
@@ -263,8 +263,8 @@ impl KVStore for FilesystemStore {
263263
264264 call ! ( unsafe {
265265 windows_sys:: Win32 :: Storage :: FileSystem :: MoveFileExW (
266- path_to_windows_str( dest_file_path) . as_ptr( ) ,
267- path_to_windows_str( trash_file_path. clone ( ) ) . as_ptr( ) ,
266+ path_to_windows_str( & dest_file_path) . as_ptr( ) ,
267+ path_to_windows_str( & trash_file_path) . as_ptr( ) ,
268268 windows_sys:: Win32 :: Storage :: FileSystem :: MOVEFILE_WRITE_THROUGH
269269 | windows_sys:: Win32 :: Storage :: FileSystem :: MOVEFILE_REPLACE_EXISTING ,
270270 )
0 commit comments