Skip to content

Commit

Permalink
Use if instead of match
Browse files Browse the repository at this point in the history
  • Loading branch information
core1024 committed Apr 17, 2024
1 parent 55cbb36 commit 70c1949
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/stremio_app/stremio_wevbiew/wevbiew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,15 @@ impl PartialUi for WebView {
_handle: nwg::ControlHandle,
) {
use nwg::Event as E;
match evt {
E::OnNotice => {
let message_queue = self.message_queue.clone();
if let Some(controller) = self.controller.get() {
let webview = controller.get_webview().expect("Cannot get vebview");
let mut message_queue = message_queue.lock().unwrap();
for msg in message_queue.drain(..) {
webview.post_web_message_as_string(msg.as_str()).ok();
}
if evt == E::OnNotice {
let message_queue = self.message_queue.clone();
if let Some(controller) = self.controller.get() {
let webview = controller.get_webview().expect("Cannot get vebview");
let mut message_queue = message_queue.lock().unwrap();
for msg in message_queue.drain(..) {
webview.post_web_message_as_string(msg.as_str()).ok();
}
}
_ => {}
}
}
}

0 comments on commit 70c1949

Please sign in to comment.