fix: clippy

This commit is contained in:
Nova
2022-09-25 03:44:43 -04:00
parent 69f7a432d5
commit 9dd8580271
4 changed files with 9 additions and 7 deletions

View File

@@ -112,7 +112,9 @@ impl Drawable for Model {
.get_or_try_init(|| { .get_or_try_init(|| {
self.pending_model_path self.pending_model_path
.get() .get()
.and_then(|path| SKModel::from_file(sk, path.as_path(), None).clone()) .and_then(|path| SKModel::from_file(sk, path.as_path(), None))
.as_ref()
.cloned()
.map(SendWrapper::new) .map(SendWrapper::new)
.ok_or(Error) .ok_or(Error)
}) })

View File

@@ -177,7 +177,7 @@ impl PanelItem {
} }
} }
pub fn if_mapped(core_surface: &Arc<CoreSurface>, surface_data: &SurfaceData) { pub fn if_mapped(_core_surface: &Arc<CoreSurface>, surface_data: &SurfaceData) {
if let Some(panel_node) = surface_data.data_map.get::<Arc<Node>>() { if let Some(panel_node) = surface_data.data_map.get::<Arc<Node>>() {
let panel_item = PanelItem::from_node(panel_node); let panel_item = PanelItem::from_node(panel_node);
@@ -473,7 +473,7 @@ impl PanelItem {
surfaces surfaces
.iter() .iter()
.find(|surf| surf.wl_surface().clone() == core_surface.wl_surface()) .find(|surf| surf.wl_surface().clone() == core_surface.wl_surface())
.map(|surf| surf.clone()) .cloned()
}); });
if let Some(toplevel_surface) = toplevel_surface { if let Some(toplevel_surface) = toplevel_surface {

View File

@@ -31,7 +31,7 @@ use std::sync::{Arc, Weak};
pub struct ClientState; pub struct ClientState;
impl ClientData for ClientState { impl ClientData for ClientState {
fn initialized(&self, client_id: ClientId) { fn initialized(&self, client_id: ClientId) {
println!("Wayland client {:?} connected", client_id.clone()); println!("Wayland client {:?} connected", client_id);
} }
fn disconnected(&self, client_id: ClientId, reason: DisconnectReason) { fn disconnected(&self, client_id: ClientId, reason: DisconnectReason) {

View File

@@ -45,13 +45,13 @@ impl XdgShellHandler for WaylandState {
if let Some(panel_node) = data.data_map.get::<Arc<Node>>() { if let Some(panel_node) = data.data_map.get::<Arc<Node>>() {
if let Some(core_surface) = data.data_map.get::<Arc<CoreSurface>>() { if let Some(core_surface) = data.data_map.get::<Arc<CoreSurface>>() {
let panel_item = PanelItem::from_node(panel_node); let panel_item = PanelItem::from_node(panel_node);
if core_surface let has_data = core_surface
.with_data(|data| { .with_data(|data| {
data.size.x = size.w as u32; data.size.x = size.w as u32;
data.size.y = size.h as u32; data.size.y = size.h as u32;
}) })
.is_some() .is_some();
{ if has_data {
panel_item.resize(); panel_item.resize();
} }
} }