summaryrefslogtreecommitdiff
path: root/engine/src/windowing/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/windowing/window.rs')
-rw-r--r--engine/src/windowing/window.rs20
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(()),