From 5383bbedcd488a933a7dd7992c61a77c11dea525 Mon Sep 17 00:00:00 2001 From: Nova Date: Mon, 11 Aug 2025 18:07:43 -0700 Subject: [PATCH] cleanup(wayland): clippy --- src/wayland/mod.rs | 1 - src/wayland/presentation.rs | 20 +++++--------------- src/wayland/registry.rs | 3 +-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/wayland/mod.rs b/src/wayland/mod.rs index 1dccc74..d33b0d4 100644 --- a/src/wayland/mod.rs +++ b/src/wayland/mod.rs @@ -21,7 +21,6 @@ use crate::{ }, }; use bevy::app::{App, Plugin, Update}; -use bevy::diagnostic::FrameCount; use bevy::ecs::schedule::IntoScheduleConfigs; use bevy::ecs::system::{Local, Res, ResMut}; use bevy::prelude::{Deref, DerefMut}; diff --git a/src/wayland/presentation.rs b/src/wayland/presentation.rs index 751431e..7f8e635 100644 --- a/src/wayland/presentation.rs +++ b/src/wayland/presentation.rs @@ -1,9 +1,7 @@ -use std::sync::{Arc, OnceLock}; - use rustix::fs::Timespec; use waynest::{ server::{ - self, Client, Dispatcher, Result, + Client, Dispatcher, Result, protocol::stable::presentation_time::{ wp_presentation::WpPresentation, wp_presentation_feedback::WpPresentationFeedback, }, @@ -13,17 +11,6 @@ use waynest::{ use crate::wayland::core::surface::Surface; -#[derive(Debug, Dispatcher)] -pub struct Presentation { - version: u32, -} - -impl Presentation { - pub fn new(version: u32) -> Presentation { - Self { version } - } -} - pub struct MonotonicTimestamp { secs: u64, subsec_nanos: u32, @@ -50,7 +37,7 @@ impl From for MonotonicTimestamp { } #[derive(Debug, Dispatcher)] -pub struct PresentationFeedback(pub ObjectId); +pub struct Presentation; impl WpPresentation for Presentation { async fn destroy(&self, _client: &mut Client, _sender_id: ObjectId) -> Result<()> { Ok(()) @@ -73,4 +60,7 @@ impl WpPresentation for Presentation { Ok(()) } } + +#[derive(Debug, Dispatcher)] +pub struct PresentationFeedback(pub ObjectId); impl WpPresentationFeedback for PresentationFeedback {} diff --git a/src/wayland/registry.rs b/src/wayland/registry.rs index 1541d55..66f5d9a 100644 --- a/src/wayland/registry.rs +++ b/src/wayland/registry.rs @@ -191,8 +191,7 @@ impl WlRegistry for Registry { RegistryGlobals::PRESENTATION => { tracing::info!("Binding wp_presentation"); - let presentation = Presentation::new(new_id.version); - client.insert(new_id.object_id, presentation); + client.insert(new_id.object_id, Presentation); } id => { tracing::error!(id, "Wayland: failed to bind to registry global");