Clippy fixes (#2011)

* windows: bump winapi version

* windows: address dark_mode FIXMEs

use now available winapi structures

* clippy: fix clippy::upper_case_acronyms warnings

* clippy: fix needless_arbitrary_self_type warnings

* clippy: fix clone_on_copy warnings

* clippy: fix unnecessary_mut_passed warnings

* clippy: fix identity_op warnings

* clippy: fix misc warnings

* prefix rustdoc lints with rustdoc::

the prefix was introduced in Rust 1.52

* windows: silence file_drop_handler is never read warning

* clippy: fix from_over_into warnings

and a bit of naming simplification

* clippy: fix missing_safety_doc warnings

* make dummy() functions const
This commit is contained in:
Philippe Renon 2021-08-30 19:40:02 +02:00 committed by GitHub
parent 9e72396709
commit 1b3b82a3c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 119 additions and 143 deletions

View file

@ -116,7 +116,7 @@ impl Window {
event_loop::WindowData {
window_state: win.window_state.clone(),
event_loop_runner: event_loop.runner_shared.clone(),
file_drop_handler,
_file_drop_handler: file_drop_handler,
userdata_removed: Cell::new(false),
recurse_depth: Cell::new(0),
}
@ -455,7 +455,7 @@ impl Window {
// string, so add it
display_name.push(0);
let mut native_video_mode = video_mode.video_mode.native_video_mode.clone();
let mut native_video_mode = video_mode.video_mode.native_video_mode;
let res = unsafe {
winuser::ChangeDisplaySettingsExW(
@ -896,7 +896,7 @@ unsafe fn post_init<T: 'static>(
win.set_maximized(true);
}
if let Some(_) = attributes.fullscreen {
if attributes.fullscreen.is_some() {
win.set_fullscreen(attributes.fullscreen);
force_window_active(win.window.0);
}
@ -986,7 +986,7 @@ unsafe fn taskbar_mark_fullscreen(handle: HWND, fullscreen: bool) {
TASKBAR_LIST.with(|task_bar_list_ptr| {
let mut task_bar_list = task_bar_list_ptr.get();
if task_bar_list == ptr::null_mut() {
if task_bar_list.is_null() {
use winapi::{shared::winerror::S_OK, Interface};
let hr = combaseapi::CoCreateInstance(