chore: silence clippy
It appears that clippy's dead code detection has gotten better. This commit fixes winit's code to match. Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
962241e2a0
commit
7b0ef160fc
11 changed files with 17 additions and 33 deletions
|
|
@ -1026,6 +1026,7 @@ impl Deref for XkbKeymap {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Modifier index in the keymap.
|
/// Modifier index in the keymap.
|
||||||
|
#[cfg_attr(not(x11_platform), allow(dead_code))]
|
||||||
#[derive(Default, Debug, Clone, Copy)]
|
#[derive(Default, Debug, Clone, Copy)]
|
||||||
pub struct ModsIndices {
|
pub struct ModsIndices {
|
||||||
pub shift: Option<xkb_mod_index_t>,
|
pub shift: Option<xkb_mod_index_t>,
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ pub struct X11WindowAttributes {
|
||||||
pub embed_window: Option<x11rb::protocol::xproto::Window>,
|
pub embed_window: Option<x11rb::protocol::xproto::Window>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(not(x11_platform), allow(clippy::derivable_impls))]
|
||||||
impl Default for PlatformSpecificWindowAttributes {
|
impl Default for PlatformSpecificWindowAttributes {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ impl Window {
|
||||||
Some(Fullscreen::Exclusive(_)) => {
|
Some(Fullscreen::Exclusive(_)) => {
|
||||||
warn!("`Fullscreen::Exclusive` is ignored on Wayland");
|
warn!("`Fullscreen::Exclusive` is ignored on Wayland");
|
||||||
}
|
}
|
||||||
|
#[cfg_attr(not(x11_platform), allow(clippy::bind_instead_of_map))]
|
||||||
Some(Fullscreen::Borderless(monitor)) => {
|
Some(Fullscreen::Borderless(monitor)) => {
|
||||||
let output = monitor.and_then(|monitor| match monitor {
|
let output = monitor.and_then(|monitor| match monitor {
|
||||||
PlatformMonitorHandle::Wayland(monitor) => Some(monitor.proxy),
|
PlatformMonitorHandle::Wayland(monitor) => Some(monitor.proxy),
|
||||||
|
|
@ -499,6 +500,7 @@ impl Window {
|
||||||
Some(Fullscreen::Exclusive(_)) => {
|
Some(Fullscreen::Exclusive(_)) => {
|
||||||
warn!("`Fullscreen::Exclusive` is ignored on Wayland");
|
warn!("`Fullscreen::Exclusive` is ignored on Wayland");
|
||||||
}
|
}
|
||||||
|
#[cfg_attr(not(x11_platform), allow(clippy::bind_instead_of_map))]
|
||||||
Some(Fullscreen::Borderless(monitor)) => {
|
Some(Fullscreen::Borderless(monitor)) => {
|
||||||
let output = monitor.and_then(|monitor| match monitor {
|
let output = monitor.and_then(|monitor| match monitor {
|
||||||
PlatformMonitorHandle::Wayland(monitor) => Some(monitor.proxy),
|
PlatformMonitorHandle::Wayland(monitor) => Some(monitor.proxy),
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ pub enum DndState {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum DndDataParseError {
|
pub enum DndDataParseError {
|
||||||
EmptyData,
|
EmptyData,
|
||||||
InvalidUtf8(Utf8Error),
|
InvalidUtf8(#[allow(dead_code)] Utf8Error),
|
||||||
HostnameSpecified(String),
|
HostnameSpecified(#[allow(dead_code)] String),
|
||||||
UnexpectedProtocol(String),
|
UnexpectedProtocol(#[allow(dead_code)] String),
|
||||||
UnresolvablePath(io::Error),
|
UnresolvablePath(#[allow(dead_code)] io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Utf8Error> for DndDataParseError {
|
impl From<Utf8Error> for DndDataParseError {
|
||||||
|
|
|
||||||
|
|
@ -40,26 +40,6 @@ impl AaRect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
|
||||||
pub struct Geometry {
|
|
||||||
pub root: xproto::Window,
|
|
||||||
// If you want positions relative to the root window, use translate_coords.
|
|
||||||
// Note that the overwhelming majority of window managers are reparenting WMs, thus the window
|
|
||||||
// ID we get from window creation is for a nested window used as the window's client area. If
|
|
||||||
// you call get_geometry with that window ID, then you'll get the position of that client area
|
|
||||||
// window relative to the parent it's nested in (the frame), which isn't helpful if you want
|
|
||||||
// to know the frame position.
|
|
||||||
pub x_rel_parent: c_int,
|
|
||||||
pub y_rel_parent: c_int,
|
|
||||||
// In that same case, this will give you client area size.
|
|
||||||
pub width: c_uint,
|
|
||||||
pub height: c_uint,
|
|
||||||
// xmonad and dwm were the only WMs tested that use the border return at all.
|
|
||||||
// The majority of WMs seem to simply fill it with 0 unconditionally.
|
|
||||||
pub border: c_uint,
|
|
||||||
pub depth: c_uint,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FrameExtents {
|
pub struct FrameExtents {
|
||||||
pub left: u32,
|
pub left: u32,
|
||||||
|
|
|
||||||
|
|
@ -753,7 +753,7 @@ impl UnownedWindow {
|
||||||
if old_fullscreen == fullscreen {
|
if old_fullscreen == fullscreen {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
shared_state_lock.fullscreen = fullscreen.clone();
|
shared_state_lock.fullscreen.clone_from(&fullscreen);
|
||||||
|
|
||||||
match (&old_fullscreen, &fullscreen) {
|
match (&old_fullscreen, &fullscreen) {
|
||||||
// Store the desktop video mode before entering exclusive
|
// Store the desktop video mode before entering exclusive
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,7 @@ impl Endianness {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parser errors.
|
/// Parser errors.
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ParserError {
|
pub enum ParserError {
|
||||||
/// Ran out of bytes.
|
/// Ran out of bytes.
|
||||||
|
|
@ -274,9 +275,8 @@ impl ParserError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
/// Tests for the XSETTINGS parser.
|
||||||
mod tests {
|
mod tests {
|
||||||
//! Tests for the XSETTINGS parser.
|
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
const XSETTINGS: &str = include_str!("tests/xsettings.dat");
|
const XSETTINGS: &str = include_str!("tests/xsettings.dat");
|
||||||
|
|
|
||||||
|
|
@ -711,7 +711,7 @@ async fn from_url(
|
||||||
async fn from_animation(
|
async fn from_animation(
|
||||||
main_thread: MainThreadMarker,
|
main_thread: MainThreadMarker,
|
||||||
duration: Duration,
|
duration: Duration,
|
||||||
cursors: impl Iterator<Item = CustomCursor> + ExactSizeIterator,
|
cursors: impl ExactSizeIterator<Item = CustomCursor>,
|
||||||
) -> Result<Animation, CustomCursorError> {
|
) -> Result<Animation, CustomCursorError> {
|
||||||
let keyframes = Array::new();
|
let keyframes = Array::new();
|
||||||
let mut images = Vec::with_capacity(cursors.len());
|
let mut images = Vec::with_capacity(cursors.len());
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,7 @@ impl Shared {
|
||||||
ControlFlow::Poll => {
|
ControlFlow::Poll => {
|
||||||
let cloned = self.clone();
|
let cloned = self.clone();
|
||||||
State::Poll {
|
State::Poll {
|
||||||
request: backend::Schedule::new(
|
_request: backend::Schedule::new(
|
||||||
self.poll_strategy(),
|
self.poll_strategy(),
|
||||||
self.window(),
|
self.window(),
|
||||||
move || cloned.poll(),
|
move || cloned.poll(),
|
||||||
|
|
@ -693,7 +693,7 @@ impl Shared {
|
||||||
State::WaitUntil {
|
State::WaitUntil {
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
timeout: backend::Schedule::new_with_duration(
|
_timeout: backend::Schedule::new_with_duration(
|
||||||
self.window(),
|
self.window(),
|
||||||
move || cloned.resume_time_reached(start, end),
|
move || cloned.resume_time_reached(start, end),
|
||||||
delay,
|
delay,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use web_time::Instant;
|
||||||
pub enum State {
|
pub enum State {
|
||||||
Init,
|
Init,
|
||||||
WaitUntil {
|
WaitUntil {
|
||||||
timeout: backend::Schedule,
|
_timeout: backend::Schedule,
|
||||||
start: Instant,
|
start: Instant,
|
||||||
end: Instant,
|
end: Instant,
|
||||||
},
|
},
|
||||||
|
|
@ -14,7 +14,7 @@ pub enum State {
|
||||||
start: Instant,
|
start: Instant,
|
||||||
},
|
},
|
||||||
Poll {
|
Poll {
|
||||||
request: backend::Schedule,
|
_request: backend::Schedule,
|
||||||
},
|
},
|
||||||
Exit,
|
Exit,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -724,7 +724,7 @@ impl Window {
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
window_state_lock.fullscreen = fullscreen.clone();
|
window_state_lock.fullscreen.clone_from(&fullscreen);
|
||||||
drop(window_state_lock);
|
drop(window_state_lock);
|
||||||
|
|
||||||
self.thread_executor.execute_in_thread(move || {
|
self.thread_executor.execute_in_thread(move || {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue