mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-11-25 21:23:49 +01:00
refactor: store handle in a variable instead of casting
This commit is contained in:
1 parent
e3d487f846
commit
57d91d9ab2
1 file changed
+2
-1
@@ -306,7 +306,8 @@ fn acquire_file_lock(lock_path: &PathBuf) -> Result<FileLockGuard, Box<dyn std::
|
||||
use windows::Win32::Storage::FileSystem::LOCKFILE_FAIL_IMMEDIATELY;
|
||||
use windows::Win32::System::IO::OVERLAPPED;
|
||||
|
||||
let handle = HANDLE(file.as_raw_handle() as *mut core::ffi::c_void);
|
||||
let raw_handle = file.as_raw_handle();
|
||||
let handle = HANDLE(raw_handle);
|
||||
unsafe {
|
||||
let mut overlapped: OVERLAPPED = std::mem::zeroed();
|
||||
if LockFileEx(
|
||||
|
||||
Reference in new issue
Block a user