Skip to content

Commit 69bf9b1

Browse files
committed
[warnings] rio-window
1 parent f1d44a4 commit 69bf9b1

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

rio-window/src/platform_impl/windows/dark_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::{ffi::c_void, ptr};
44

55
use crate::utils::Lazy;
66
use windows_sys::core::PCSTR;
7+
use windows_sys::s;
78
use windows_sys::Win32::Foundation::{BOOL, HWND, NTSTATUS, S_OK};
89
use windows_sys::Win32::System::LibraryLoader::{GetProcAddress, LoadLibraryA};
910
use windows_sys::Win32::System::SystemInformation::OSVERSIONINFOW;
@@ -146,7 +147,7 @@ fn should_apps_use_dark_mode() -> bool {
146147
return None;
147148
}
148149

149-
let module = LoadLibraryA("uxtheme.dll\0".as_ptr());
150+
let module = LoadLibraryA(s!("uxtheme.dll"));
150151

151152
if module.is_null() {
152153
return None;

rio-window/src/platform_impl/windows/event_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ fn dur2timeout(dur: Duration) -> u32 {
637637
.checked_mul(1000)
638638
.and_then(|ms| ms.checked_add((dur.subsec_nanos() as u64) / 1_000_000))
639639
.and_then(|ms| {
640-
if dur.subsec_nanos() % 1_000_000 > 0 {
640+
if !dur.subsec_nanos().is_multiple_of(1_000_000) {
641641
ms.checked_add(1)
642642
} else {
643643
Some(ms)

rio-window/src/platform_impl/windows/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(non_snake_case)]
2+
13
use std::ffi::{c_void, OsStr, OsString};
24
use std::iter::once;
35
use std::ops::BitAnd;

rio-window/src/window.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,10 +1846,11 @@ pub enum WindowLevel {
18461846
/// ## Platform-specific
18471847
///
18481848
/// - **iOS / Android / Web / Windows / X11 / macOS / Orbital:** Unsupported.
1849-
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
1849+
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
18501850
#[non_exhaustive]
18511851
pub enum ImePurpose {
18521852
/// No special hints for the IME (default).
1853+
#[default]
18531854
Normal,
18541855
/// The IME is used for password input.
18551856
Password,
@@ -1859,12 +1860,6 @@ pub enum ImePurpose {
18591860
Terminal,
18601861
}
18611862

1862-
impl Default for ImePurpose {
1863-
fn default() -> Self {
1864-
Self::Normal
1865-
}
1866-
}
1867-
18681863
/// An opaque token used to activate the [`Window`].
18691864
///
18701865
/// [`Window`]: crate::window::Window

0 commit comments

Comments
 (0)