clean up warnings from github

This commit is contained in:
i509VCB 2021-11-22 13:46:34 -06:00 committed by Victor Berger
parent 2db2611817
commit 7b1c0501f3
7 changed files with 13 additions and 25 deletions

View File

@ -85,7 +85,8 @@ impl WindowSize {
#[derive(Debug)] #[derive(Debug)]
pub struct WinitGraphicsBackend { pub struct WinitGraphicsBackend {
renderer: Gles2Renderer, renderer: Gles2Renderer,
display: EGLDisplay, // The display isn't used past this point but must be kept alive.
_display: EGLDisplay,
egl: Rc<EGLSurface>, egl: Rc<EGLSurface>,
window: Rc<WinitWindow>, window: Rc<WinitWindow>,
size: Rc<RefCell<WindowSize>>, size: Rc<RefCell<WindowSize>>,
@ -223,7 +224,7 @@ where
Ok(( Ok((
WinitGraphicsBackend { WinitGraphicsBackend {
window: window.clone(), window: window.clone(),
display, _display: display,
egl, egl,
renderer, renderer,
size: size.clone(), size: size.clone(),

View File

@ -83,7 +83,7 @@ use x11rb::{
protocol::{ protocol::{
self as x11, self as x11,
dri3::ConnectionExt as _, dri3::ConnectionExt as _,
xproto::{ColormapAlloc, ConnectionExt, Depth, PixmapWrapper, VisualClass}, xproto::{ColormapAlloc, ConnectionExt, PixmapWrapper, VisualClass},
ErrorKind, ErrorKind,
}, },
rust_connection::{ReplyError, RustConnection}, rust_connection::{ReplyError, RustConnection},
@ -124,8 +124,6 @@ pub struct X11Backend {
window: Arc<WindowInner>, window: Arc<WindowInner>,
resize: Sender<Size<u16, Logical>>, resize: Sender<Size<u16, Logical>>,
key_counter: Arc<AtomicU32>, key_counter: Arc<AtomicU32>,
depth: Depth,
visual_id: u32,
} }
atom_manager! { atom_manager! {
@ -231,7 +229,7 @@ impl X11Backend {
title, title,
format, format,
atoms, atoms,
depth.clone(), depth,
visual_id, visual_id,
colormap, colormap,
extensions, extensions,
@ -254,8 +252,6 @@ impl X11Backend {
connection, connection,
window, window,
key_counter: Arc::new(AtomicU32::new(0)), key_counter: Arc::new(AtomicU32::new(0)),
depth,
visual_id,
screen_number, screen_number,
resize: resize_send, resize: resize_send,
}; };

View File

@ -57,7 +57,6 @@ pub(crate) struct WindowInner {
pub connection: Weak<RustConnection>, pub connection: Weak<RustConnection>,
pub id: x11::Window, pub id: x11::Window,
root: x11::Window, root: x11::Window,
present_event_id: u32,
pub atoms: Atoms, pub atoms: Atoms,
pub cursor_state: Arc<Mutex<CursorState>>, pub cursor_state: Arc<Mutex<CursorState>>,
pub size: Mutex<Size<u16, Logical>>, pub size: Mutex<Size<u16, Logical>>,
@ -147,7 +146,6 @@ impl WindowInner {
connection: weak, connection: weak,
id: window, id: window,
root: screen.root, root: screen.root,
present_event_id,
atoms, atoms,
cursor_state: Arc::new(Mutex::new(CursorState::default())), cursor_state: Arc::new(Mutex::new(CursorState::default())),
size: Mutex::new(size), size: Mutex::new(size),

View File

@ -29,7 +29,7 @@ struct Inner {
scale: i32, scale: i32,
instances: Vec<ZxdgOutputV1>, instances: Vec<ZxdgOutputV1>,
log: ::slog::Logger, _log: ::slog::Logger,
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
@ -58,7 +58,7 @@ impl XdgOutput {
scale: output.scale, scale: output.scale,
instances: Vec::new(), instances: Vec::new(),
log, _log: log,
})), })),
} }
} }

View File

@ -165,7 +165,7 @@ impl LayerShellState {
#[derive(Clone)] #[derive(Clone)]
struct ShellUserData { struct ShellUserData {
log: ::slog::Logger, _log: ::slog::Logger,
user_impl: Rc<RefCell<dyn FnMut(LayerShellRequest, DispatchData<'_>)>>, user_impl: Rc<RefCell<dyn FnMut(LayerShellRequest, DispatchData<'_>)>>,
shell_state: Arc<Mutex<LayerShellState>>, shell_state: Arc<Mutex<LayerShellState>>,
} }
@ -189,7 +189,7 @@ where
})); }));
let shell_data = ShellUserData { let shell_data = ShellUserData {
log: log.new(slog::o!("smithay_module" => "layer_shell_handler")), _log: log.new(slog::o!("smithay_module" => "layer_shell_handler")),
user_impl: Rc::new(RefCell::new(implementation)), user_impl: Rc::new(RefCell::new(implementation)),
shell_state: shell_state.clone(), shell_state: shell_state.clone(),
}; };

View File

@ -133,7 +133,7 @@ impl XdgActivationTokenData {
/// Tracks the list of pending and current activation requests /// Tracks the list of pending and current activation requests
#[derive(Debug)] #[derive(Debug)]
pub struct XdgActivationState { pub struct XdgActivationState {
log: ::slog::Logger, _log: ::slog::Logger,
user_data: UserDataMap, user_data: UserDataMap,
pending_tokens: HashMap<XdgActivationToken, XdgActivationTokenData>, pending_tokens: HashMap<XdgActivationToken, XdgActivationTokenData>,
@ -203,7 +203,7 @@ where
let implementation = Rc::new(RefCell::new(implementation)); let implementation = Rc::new(RefCell::new(implementation));
let activation_state = Arc::new(Mutex::new(XdgActivationState { let activation_state = Arc::new(Mutex::new(XdgActivationState {
log: log.new(slog::o!("smithay_module" => "xdg_activation_handler")), _log: log.new(slog::o!("smithay_module" => "xdg_activation_handler")),
user_data: UserDataMap::new(), user_data: UserDataMap::new(),
pending_tokens: HashMap::new(), pending_tokens: HashMap::new(),
activation_requests: HashMap::new(), activation_requests: HashMap::new(),

View File

@ -47,8 +47,7 @@ use wayland_server::{Display, Filter, Global, Main};
/// Manages all exported and imported surfaces. /// Manages all exported and imported surfaces.
#[derive(Debug)] #[derive(Debug)]
pub struct XdgForeignState { pub struct XdgForeignState {
log: ::slog::Logger, _log: ::slog::Logger,
shell: Arc<Mutex<ShellState>>,
exports: Vec<Export>, exports: Vec<Export>,
} }
@ -85,9 +84,8 @@ where
let log = crate::slog_or_fallback(logger); let log = crate::slog_or_fallback(logger);
let state = Arc::new(Mutex::new(XdgForeignState { let state = Arc::new(Mutex::new(XdgForeignState {
log: log.new(slog::o!("smithay_module" => "xdg_foreign_handler")), _log: log.new(slog::o!("smithay_module" => "xdg_foreign_handler")),
exports: vec![], exports: vec![],
shell: xdg_shell_state.clone(),
})); }));
// Borrow checking does not like us cloning the state inside the filter's closure so we clone // Borrow checking does not like us cloning the state inside the filter's closure so we clone
@ -121,8 +119,6 @@ struct Export {
inner: zxdg_exported_v2::ZxdgExportedV2, inner: zxdg_exported_v2::ZxdgExportedV2,
/// All imports made from this export. /// All imports made from this export.
imports: Vec<Import>, imports: Vec<Import>,
/// Whether this export was created by the compositor or a client.
compositor_created: bool,
} }
impl Export { impl Export {
@ -152,7 +148,6 @@ impl PartialEq for Export {
struct Import { struct Import {
inner: zxdg_imported_v2::ZxdgImportedV2, inner: zxdg_imported_v2::ZxdgImportedV2,
surface: WlSurface, surface: WlSurface,
handle: String,
/// Child surfaces which have imported this surface as a parent. /// Child surfaces which have imported this surface as a parent.
children: Vec<WlSurface>, children: Vec<WlSurface>,
} }
@ -291,7 +286,6 @@ fn exporter_implementation(
handle: handle.clone(), handle: handle.clone(),
inner: id.deref().clone(), inner: id.deref().clone(),
imports: vec![], imports: vec![],
compositor_created: false,
}); });
handle handle
@ -370,7 +364,6 @@ fn importer_implementation(
export.imports.push(Import { export.imports.push(Import {
inner, inner,
surface: export.surface.clone(), surface: export.surface.clone(),
handle: export.handle.clone(),
children: vec![], children: vec![],
}); });
} }