Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #2076

Merged
merged 6 commits into from
Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
18 changes: 9 additions & 9 deletions examples/request_redraw_threaded.rs
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
2 changes: 1 addition & 1 deletion examples/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions src/platform_impl/ios/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
size: PhysicalSize<u32>,
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/linux/x11/ime/input_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ unsafe fn open_im(xconn: &Arc<XConnection>, locale_modifiers: &CStr) -> Option<f
#[derive(Debug)]
pub struct InputMethod {
pub im: ffi::XIM,
name: String,
_name: String,
}

impl InputMethod {
fn new(im: ffi::XIM, name: String) -> Self {
InputMethod { im, name }
InputMethod { im, _name: name }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/linux/x11/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -658,7 +658,7 @@ impl Device {
}

let mut device = Device {
name: name.into_owned(),
_name: name.into_owned(),
scroll_axes,
attachment: info.attachment,
};
Expand Down
1 change: 1 addition & 0 deletions src/platform_impl/macos/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
native_identifier: u32,
Expand Down