mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Fix warnings (#2076)
* examples: Fix unused `Result` that must be used when initializing console_log * examples: Fix unused imports * Fix unread name field warning in linux x11 ime InputMethod struct * Fix unread name field warning in linux x11 Device struct * Ignore unread field warning in macos/ios MonitorHandle struct * ci: Add `--deny warnings` to `RUSTFLAGS`
This commit is contained in:
parent
20d012ae3f
commit
18a61f1058
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -50,7 +50,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
RUSTFLAGS: "-C debuginfo=0"
|
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
|
||||||
OPTIONS: ${{ matrix.platform.options }}
|
OPTIONS: ${{ matrix.platform.options }}
|
||||||
FEATURES: ${{ format(',{0}', matrix.platform.features ) }}
|
FEATURES: ${{ format(',{0}', matrix.platform.features ) }}
|
||||||
CMD: ${{ matrix.platform.cmd }}
|
CMD: ${{ matrix.platform.cmd }}
|
||||||
|
|
|
@ -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"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
fn main() {
|
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();
|
SimpleLogger::new().init().unwrap();
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new();
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ mod wasm {
|
||||||
|
|
||||||
#[wasm_bindgen(start)]
|
#[wasm_bindgen(start)]
|
||||||
pub fn run() {
|
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();
|
super::main();
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,9 @@ impl Drop for MonitorHandle {
|
||||||
|
|
||||||
impl fmt::Debug for MonitorHandle {
|
impl fmt::Debug for MonitorHandle {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
// TODO: Do this using the proper fmt API
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct MonitorHandle {
|
struct MonitorHandle {
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
size: PhysicalSize<u32>,
|
size: PhysicalSize<u32>,
|
||||||
|
|
|
@ -42,12 +42,12 @@ unsafe fn open_im(xconn: &Arc<XConnection>, locale_modifiers: &CStr) -> Option<f
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct InputMethod {
|
pub struct InputMethod {
|
||||||
pub im: ffi::XIM,
|
pub im: ffi::XIM,
|
||||||
name: String,
|
_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InputMethod {
|
impl InputMethod {
|
||||||
fn new(im: ffi::XIM, name: String) -> Self {
|
fn new(im: ffi::XIM, name: String) -> Self {
|
||||||
InputMethod { im, name }
|
InputMethod { im, _name: name }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -592,7 +592,7 @@ fn mkdid(w: c_int) -> crate::event::DeviceId {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Device {
|
struct Device {
|
||||||
name: String,
|
_name: String,
|
||||||
scroll_axes: Vec<(i32, ScrollAxis)>,
|
scroll_axes: Vec<(i32, ScrollAxis)>,
|
||||||
// For master devices, this is the paired device (pointer <-> keyboard).
|
// For master devices, this is the paired device (pointer <-> keyboard).
|
||||||
// For slave devices, this is the master.
|
// For slave devices, this is the master.
|
||||||
|
@ -658,7 +658,7 @@ impl Device {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut device = Device {
|
let mut device = Device {
|
||||||
name: name.into_owned(),
|
_name: name.into_owned(),
|
||||||
scroll_axes,
|
scroll_axes,
|
||||||
attachment: info.attachment,
|
attachment: info.attachment,
|
||||||
};
|
};
|
||||||
|
|
|
@ -162,6 +162,7 @@ impl fmt::Debug for MonitorHandle {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
// TODO: Do this using the proper fmt API
|
// TODO: Do this using the proper fmt API
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct MonitorHandle {
|
struct MonitorHandle {
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
native_identifier: u32,
|
native_identifier: u32,
|
||||||
|
|
Loading…
Reference in a new issue