Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 24, 2023
1 parent b6dd62e commit f55344c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {
gtk::main();
});

let event_loop = EventLoopBuilder::new().build();
let event_loop = EventLoopBuilder::new().build().unwrap();

#[cfg(not(target_os = "linux"))]
let mut tray_icon = Some(
Expand All @@ -46,13 +46,13 @@ fn main() {
let menu_channel = MenuEvent::receiver();
let tray_channel = TrayIconEvent::receiver();

event_loop.run(move |_event, _, control_flow| {
*control_flow = ControlFlow::Poll;
event_loop.run(move |_event, event_loop| {
event_loop.set_control_flow(ControlFlow::Poll);

if let Ok(event) = tray_channel.try_recv() {
println!("{event:?}");
}
})
});
}

fn load_icon(path: &std::path::Path) -> tray_icon::Icon {
Expand Down
2 changes: 2 additions & 0 deletions src/platform_impl/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ impl TrayIcon {
};
if let Some(tooltip) = &tooltip {
let tip = util::encode_wide(tooltip.as_ref());
#[allow(clippy::manual_memcpy)]
for i in 0..tip.len().min(128) {
nid.szTip[i] = tip[i];
}
Expand Down Expand Up @@ -410,6 +411,7 @@ unsafe fn register_tray_icon(
if let Some(tooltip) = tooltip {
flags |= NIF_TIP;
let tip = util::encode_wide(tooltip);
#[allow(clippy::manual_memcpy)]
for i in 0..tip.len().min(128) {
sz_tip[i] = tip[i];
}
Expand Down

0 comments on commit f55344c

Please sign in to comment.