Make WindowId::primary() const (#6582)

# Objective

- fixes https://github.com/bevyengine/bevy/issues/6577

## Solution

- simply add `const` to `primary()`.
This commit is contained in:
张林伟 2022-11-14 23:08:24 +00:00
parent 1f8cc9dd67
commit 8f9556050a

View File

@ -92,7 +92,7 @@ impl WindowId {
WindowId(Uuid::new_v4()) WindowId(Uuid::new_v4())
} }
/// The [`WindowId`] for the primary window. /// The [`WindowId`] for the primary window.
pub fn primary() -> Self { pub const fn primary() -> Self {
WindowId(Uuid::from_u128(0)) WindowId(Uuid::from_u128(0))
} }
/// Get whether or not this [`WindowId`] is for the primary window. /// Get whether or not this [`WindowId`] is for the primary window.