From aec4dfdaa0dbc4382fcf5a8d2dd571ed4ce037a5 Mon Sep 17 00:00:00 2001 From: LapinoLapidus Date: Fri, 17 Jul 2020 23:12:16 +0000 Subject: [PATCH] Update winrt to 0.6.0 --- Cargo.toml | 2 +- src/lib.rs | 18 +++--------------- 2 file(s) changed, 4 insertion(s)(+), 16 deletion(s)(-) diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,4 @@ 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 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,9 +11,6 @@ use notify_rust::error::Error as LError; #[cfg(target_os = "windows")] -extern crate winrt; - -#[cfg(target_os = "windows")] use winrt::Error as WError; use std::{ @@ -111,12 +108,12 @@ } #[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,17 +140,8 @@ 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(); - } } } -- tangled.sh