diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
| commit | c73ab25c9dbe40284cfd38beaf31e2a20a9810de (patch) | |
| tree | 51c5817a0c252a172c03a47e36886e563a4e623d /engine/src/windowing/window.rs | |
| parent | 2ccda0cd5f81909fddc74d95f960f781a64bcae1 (diff) | |
refactor(engine): fix portion of clippy lints
Diffstat (limited to 'engine/src/windowing/window.rs')
| -rw-r--r-- | engine/src/windowing/window.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engine/src/windowing/window.rs b/engine/src/windowing/window.rs index 6d7a464..ae4a36b 100644 --- a/engine/src/windowing/window.rs +++ b/engine/src/windowing/window.rs @@ -59,6 +59,7 @@ macro_rules! gen_creation_attrs_with_fn { paste::paste! { impl CreationAttributes { + #[must_use] pub fn [<with_ $field>](mut self, new: impl Into<$field_type>) -> Self { self.$field = new.into(); @@ -93,12 +94,9 @@ impl CreationAttributes .with_title(self.title.into_owned()) .with_transparent(self.transparent) .with_maximized(self.maximized) - .with_fullscreen(match self.fullscreen { - Some(Fullscreen::Borderless) => { - Some(winit::window::Fullscreen::Borderless(None)) - } - None => None, - }) + .with_fullscreen(self.fullscreen.map(|Fullscreen::Borderless| { + winit::window::Fullscreen::Borderless(None) + })) .with_visible(self.visible) .with_resizable(self.resizable) .with_window_icon(match self.icon { @@ -212,11 +210,13 @@ pub struct Window impl Window { + #[must_use] pub fn wid(&self) -> Id { self.wid } + #[must_use] pub fn scale_factor(&self) -> f64 { self.scale_factor @@ -243,11 +243,11 @@ impl Window winit_window.set_title(&self.title); winit_window.set_cursor_visible(self.cursor_visible); - let curr_inner_size = winit_window.inner_size().clone().into(); + let curr_inner_size = winit_window.inner_size().into(); - let inner_size_request_result = match winit_window.request_inner_size( - winit::dpi::Size::Physical(self.inner_size.clone().into()), - ) { + let inner_size_request_result = match winit_window + .request_inner_size(winit::dpi::Size::Physical(self.inner_size.into())) + { // The comparison of curr_inner_size is in case the user's windowing system // lies about using the requested inner size None if curr_inner_size == self.inner_size => Ok(()), |
