From 48ec9e5e80a53af22f2efc1e4b997702bd7fa60a Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 12:31:31 +0100 Subject: [PATCH 1/6] examples: Fix unused `Result` that must be used when initializing console_log --- examples/web.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/web.rs b/examples/web.rs index 1936bc2b90..83ccc45ee2 100644 --- a/examples/web.rs +++ b/examples/web.rs @@ -51,7 +51,7 @@ mod wasm { #[wasm_bindgen(start)] pub fn run() { - console_log::init_with_level(log::Level::Debug); + console_log::init_with_level(log::Level::Debug).expect("error initializing logger"); super::main(); } From c60439eda4f1289b50efba29fad56a52c6b5a17d Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 12:32:14 +0100 Subject: [PATCH 2/6] examples: Fix unused imports --- examples/request_redraw_threaded.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/request_redraw_threaded.rs b/examples/request_redraw_threaded.rs index d725cc8d93..7a28c23b55 100644 --- a/examples/request_redraw_threaded.rs +++ b/examples/request_redraw_threaded.rs @@ -1,14 +1,14 @@ -use std::{thread, time}; - -use simple_logger::SimpleLogger; -use winit::{ - event::{Event, WindowEvent}, - event_loop::{ControlFlow, EventLoop}, - window::WindowBuilder, -}; - #[cfg(not(target_arch = "wasm32"))] fn main() { + use std::{thread, time}; + + use simple_logger::SimpleLogger; + use winit::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, + }; + SimpleLogger::new().init().unwrap(); let event_loop = EventLoop::new(); From cf74e254ee3d47a44f35bd16528166a9358722e0 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 12:45:02 +0100 Subject: [PATCH 3/6] Fix unread name field warning in linux x11 ime InputMethod struct --- src/platform_impl/linux/x11/ime/input_method.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/linux/x11/ime/input_method.rs b/src/platform_impl/linux/x11/ime/input_method.rs index 142c150199..808dfcb7d3 100644 --- a/src/platform_impl/linux/x11/ime/input_method.rs +++ b/src/platform_impl/linux/x11/ime/input_method.rs @@ -42,12 +42,12 @@ unsafe fn open_im(xconn: &Arc, locale_modifiers: &CStr) -> Option Self { - InputMethod { im, name } + InputMethod { im, _name: name } } } From 40dffa2a43609f3806d57dd6d48aff8a91286938 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 13:38:29 +0100 Subject: [PATCH 4/6] Fix unread name field warning in linux x11 Device struct --- src/platform_impl/linux/x11/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 3ea03b1eb8..7adf80e902 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -592,7 +592,7 @@ fn mkdid(w: c_int) -> crate::event::DeviceId { #[derive(Debug)] struct Device { - name: String, + _name: String, scroll_axes: Vec<(i32, ScrollAxis)>, // For master devices, this is the paired device (pointer <-> keyboard). // For slave devices, this is the master. @@ -658,7 +658,7 @@ impl Device { } let mut device = Device { - name: name.into_owned(), + _name: name.into_owned(), scroll_axes, attachment: info.attachment, }; From 68273a46abc70b4090bc95906c658f86ea430d53 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 13:45:51 +0100 Subject: [PATCH 5/6] Ignore unread field warning in macos/ios MonitorHandle struct --- src/platform_impl/ios/monitor.rs | 2 ++ src/platform_impl/macos/monitor.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/platform_impl/ios/monitor.rs b/src/platform_impl/ios/monitor.rs index 42c71ffc7a..4ba3a3dbb3 100644 --- a/src/platform_impl/ios/monitor.rs +++ b/src/platform_impl/ios/monitor.rs @@ -168,7 +168,9 @@ impl Drop for MonitorHandle { impl fmt::Debug for MonitorHandle { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // TODO: Do this using the proper fmt API #[derive(Debug)] + #[allow(dead_code)] struct MonitorHandle { name: Option, size: PhysicalSize, diff --git a/src/platform_impl/macos/monitor.rs b/src/platform_impl/macos/monitor.rs index 817d38ee57..cf16f97dbc 100644 --- a/src/platform_impl/macos/monitor.rs +++ b/src/platform_impl/macos/monitor.rs @@ -162,6 +162,7 @@ impl fmt::Debug for MonitorHandle { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // TODO: Do this using the proper fmt API #[derive(Debug)] + #[allow(dead_code)] struct MonitorHandle { name: Option, native_identifier: u32, From 24900bc3ba83b2f9ba0ad8a3359b757219a4c99f Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 28 Nov 2021 23:52:48 +0100 Subject: [PATCH 6/6] ci: Add `--deny warnings` to `RUSTFLAGS` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27bdf19b50..1457eaa5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: env: RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" + RUSTFLAGS: "-C debuginfo=0 --deny warnings" OPTIONS: ${{ matrix.platform.options }} FEATURES: ${{ format(',{0}', matrix.platform.features ) }} CMD: ${{ matrix.platform.cmd }}