Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to winapi 0.3 #2

Merged
merged 1 commit into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "app_dirs2"
version = "2.0.3"
version = "2.0.4"
authors = ["Andy Barron <AndrewLBarron@gmail.com>", "Simon Heath <icefoxen@gmail.com>"]

description = "Put your app's data in the right place on every platform -- maintained fork."
Expand All @@ -14,6 +14,4 @@ license = "MIT"
xdg = "^2.0.0"

[target.'cfg(windows)'.dependencies]
ole32-sys = "^0.2.0"
shell32-sys = "^0.1.1"
winapi = "^0.2.8"
winapi = { version = "0.3.8", features = ["shlobj", "combaseapi"] }
10 changes: 5 additions & 5 deletions src/imp/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
//
// Credit for the above code goes to Connorcpu (https://github.com/Connorcpu).

extern crate ole32;
extern crate shell32;
extern crate winapi;
use AppDataType::*;
use common::*;
use self::shell32::SHGetKnownFolderPath;
use self::winapi::{GUID, PWSTR};
use self::winapi::shared::guiddef::GUID;
use self::winapi::um::combaseapi::CoTaskMemFree;
use self::winapi::um::shlobj::SHGetKnownFolderPath;
use self::winapi::um::winnt::PWSTR;
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
use std::path::PathBuf;
Expand Down Expand Up @@ -71,7 +71,7 @@ static FOLDERID_ProgramData: GUID = GUID {
struct SafePwstr(PWSTR);
impl Drop for SafePwstr {
fn drop(&mut self) {
unsafe { ole32::CoTaskMemFree(self.0 as *mut _) }
unsafe { CoTaskMemFree(self.0 as *mut _) }
}
}

Expand Down