From 82cc9c4d19d72b7d113eab3bae6e22fb2eadaaca Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 9 Apr 2019 22:07:59 -0400 Subject: [PATCH] Fix compilation on Windows. Fixes https://github.com/frewsxcv/rust-notifica/issues/1 --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8fef0fe..cc5d2c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,7 @@ extern crate winrt; trait Platform { fn setup() -> Self; fn notify(msg_title: &str, msg_body: &str); - fn teardown(&mut self); + fn teardown(self); } #[cfg(target_os = "windows")] @@ -67,7 +67,7 @@ impl Platform for Windows { } } - fn teardown(&mut self) { + fn teardown(self) { self.0.uninit(); } } @@ -87,7 +87,7 @@ impl Platform for MacOs { mac_notification_sys::send_notification(msg_title, &None, msg_body, &None).unwrap(); } - fn teardown(&mut self) {} + fn teardown(self) {} } #[cfg(target_os = "linux")] @@ -107,7 +107,7 @@ impl Platform for Linux { .unwrap(); } - fn teardown(&mut self) {} + fn teardown(self) {} } #[cfg(target_os = "windows")] @@ -118,7 +118,7 @@ type CurrPlatform = MacOs; type CurrPlatform = Linux; pub fn notify(msg_title: &str, msg_body: &str) { - let mut p = CurrPlatform::setup(); + let p = CurrPlatform::setup(); CurrPlatform::notify(msg_title, msg_body); p.teardown(); } \ No newline at end of file -- 2.51.2