refactor: minor clippy warns

WIP/draft
drendog 2024-08-21 00:52:30 +02:00
parent 0aea66005f
commit 3f499429d7
Signed by: dwenya
GPG Key ID: 8DD77074645332D0
4 changed files with 6 additions and 4 deletions

View File

@ -83,6 +83,7 @@ impl WindowingSystemBuilder {
self
}
#[allow(clippy::missing_errors_doc)]
pub fn build(&mut self) -> Result<WindowingSystem> {
match self.config.component_definition {
Some(_) => WindowingSystem::new(&mut self.config),

View File

@ -51,7 +51,7 @@ impl WindowingSystem {
&layer_shell,
&event_queue.handle(),
config,
)?;
);
let pointer = Rc::new(seat.get_pointer(&event_queue.handle(), ()));
@ -104,7 +104,7 @@ impl WindowingSystem {
layer_shell: &ZwlrLayerShellV1,
queue_handle: &QueueHandle<WindowState>,
config: &config::WindowConfig,
) -> Result<(Rc<WlSurface>, Rc<ZwlrLayerSurfaceV1>)> {
) -> (Rc<WlSurface>, Rc<ZwlrLayerSurfaceV1>) {
let surface = Rc::new(compositor.create_surface(queue_handle, ()));
let layer_surface = Rc::new(layer_shell.get_layer_surface(
&surface,
@ -117,7 +117,7 @@ impl WindowingSystem {
Self::configure_layer_surface(&layer_surface, &surface, config);
Ok((surface, layer_surface))
(surface, layer_surface)
}
fn configure_layer_surface(

View File

@ -23,7 +23,7 @@ pub struct WindowStateBuilder {
impl WindowStateBuilder {
pub fn new() -> Self {
Default::default()
Self::default()
}
pub fn surface(mut self, surface: Rc<WlSurface>) -> Self {

View File

@ -63,6 +63,7 @@ impl WindowState {
self.size = new_size;
}
#[allow(clippy::cast_possible_truncation)]
pub fn set_current_pointer_position(&mut self, physical_x: f64, physical_y: f64) {
let scale_factor = self.scale_factor;
let logical_position = LogicalPosition::new(