diff --git a/clients/desktop/src-tauri/src/cloud_files/windows.rs b/clients/desktop/src-tauri/src/cloud_files/windows.rs index 11e477e..9b2a014 100644 --- a/clients/desktop/src-tauri/src/cloud_files/windows.rs +++ b/clients/desktop/src-tauri/src/cloud_files/windows.rs @@ -246,18 +246,16 @@ fn connect_callbacks(mount_point: &Path) -> Result<(), String> { let path_wide = U16CString::from_str(mount_point.to_string_lossy().as_ref()) .map_err(|e| e.to_string())?; - let mut key = CF::CF_CONNECTION_KEY::default(); - unsafe { + let key = unsafe { CF::CfConnectSyncRoot( PCWSTR(path_wide.as_ptr()), callbacks.as_ptr(), None, CF::CF_CONNECT_FLAG_REQUIRE_PROCESS_INFO | CF::CF_CONNECT_FLAG_REQUIRE_FULL_FILE_PATH, - &mut key, ) - .map_err(|e| format!("CfConnectSyncRoot: {e}"))?; - } + .map_err(|e| format!("CfConnectSyncRoot: {e}"))? + }; *CONNECTION_KEY.lock().unwrap() = Some(key); Ok(()) }