Skip to content

Commit f5e4d2f

Browse files
authored
don't panic on notify error (#10)
1 parent 79c56cc commit f5e4d2f

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wsl2-dns-agent"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
edition = "2021"
55
license = "GPL-3.0"
66
description = "An agent that automatically patches your WSL2 DNS configuration for users of Cisco AnyConnect (or similar VPNs)"
@@ -18,7 +18,7 @@ serde = { version = "1.0.137", features = ["derive"] }
1818
simplelog = "0.12.0"
1919
thiserror = "1.0.31"
2020
toml = "0.5.9"
21-
win32-utils = { git = "https://github.com/jacob-pro/win32-utils", features = ["net", "window", "instance"] }
21+
win32-utils = { git = "https://github.com/jacob-pro/win32-utils", features = ["net", "window", "instance"], rev = "055c60695dbc4d300f3caaacec25ae82415fa545" }
2222

2323
[dependencies.windows]
2424
version = "0.37.0"

src/runner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub fn start_runner(config: Config, rx: mpsc::Receiver<RunReason>, tray: TrayHan
4949
}
5050

5151
#[derive(Debug, Error)]
52+
#[allow(clippy::enum_variant_names)]
5253
enum Error {
5354
#[error("Win32 DNS error: {0}")]
5455
Dns(

src/tray.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ impl TrayProperties {
188188
.copy_to_wchar_buffer(&mut self.icon.szInfoTitle)
189189
.unwrap();
190190
message.copy_to_wchar_buffer(&mut self.icon.szInfo).unwrap();
191-
Shell_NotifyIconW(NIM_MODIFY, &self.icon).ok().unwrap();
191+
// https://github.com/jacob-pro/wsl2-dns-agent/issues/9
192+
Shell_NotifyIconW(NIM_MODIFY, &self.icon);
192193
}
193194

194195
unsafe fn show_tray_menu(&self) {

0 commit comments

Comments
 (0)