From 8f9556050ad51748146572aeb477e1842f755761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9E=97=E4=BC=9F?= Date: Mon, 14 Nov 2022 23:08:24 +0000 Subject: [PATCH] Make WindowId::primary() const (#6582) # Objective - fixes https://github.com/bevyengine/bevy/issues/6577 ## Solution - simply add `const` to `primary()`. --- crates/bevy_window/src/window.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index 868ec8a98a..f060377137 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -92,7 +92,7 @@ impl WindowId { WindowId(Uuid::new_v4()) } /// The [`WindowId`] for the primary window. - pub fn primary() -> Self { + pub const fn primary() -> Self { WindowId(Uuid::from_u128(0)) } /// Get whether or not this [`WindowId`] is for the primary window.