diff --git a/Cargo.toml b/Cargo.toml index be24fe7..5e5ca8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,4 @@ mac-notification-sys = "0.2.0" notify-rust = "3.3" [target.'cfg(windows)'.dependencies] -winrt = {version = "0.5.0", features = ["windows-data", "windows-ui"]} +winrt = {version = "0.6.0", features = ["windows-data", "windows-ui"]} diff --git a/src/lib.rs b/src/lib.rs index 32b9abd..aeb758b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,9 +10,6 @@ extern crate notify_rust; #[cfg(target_os = "linux")] use notify_rust::error::Error as LError; -#[cfg(target_os = "windows")] -extern crate winrt; - #[cfg(target_os = "windows")] use winrt::Error as WError; @@ -111,12 +108,12 @@ impl From for Error { } #[cfg(target_os = "windows")] -struct Windows(Option); +struct Windows; #[cfg(target_os = "windows")] impl Platform for Windows { fn setup() -> Self { - Windows(Some(winrt::RuntimeContext::init())) + Windows } fn notify(msg_title: &str, msg_body: &str) -> Result<(), Error> { @@ -143,20 +140,11 @@ impl Platform for Windows { ToastNotificationManager::create_toast_notifier_with_id(&FastHString::new( "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe", ))?.unwrap() - .show(&*toast)?; + .show(&*toast)?; Ok(()) } } -#[cfg(target_os = "windows")] -impl Drop for Windows { - fn drop(&mut self) { - if let Some(runtime_context) = self.0.take() { - runtime_context.uninit(); - } - } -} - #[cfg(target_os = "macos")] struct MacOs;