Make function Size::new const for bevy_ui widgets (#6602)

# Objective

Fixes #6594 

## Solution

- `New` function for `Size` is now a `const` function :)

## Changelog

- `New` function for `Size` is now a `const` function

## Migration Guide

- Nothing has been changed
This commit is contained in:
Daniél Kerkmann 2022-11-14 23:08:29 +00:00
parent 13abb1fc16
commit 6993f3cfe3

View File

@ -338,7 +338,7 @@ impl Size {
/// assert_eq!(size.width, Val::Px(100.0));
/// assert_eq!(size.height, Val::Px(200.0));
/// ```
pub fn new(width: Val, height: Val) -> Self {
pub const fn new(width: Val, height: Val) -> Self {
Size { width, height }
}