Skip to content

Commit

Permalink
Make function Size::new const for bevy_ui widgets (#6602)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
kerkmann committed Nov 14, 2022
1 parent 13abb1f commit 6993f3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand Down

0 comments on commit 6993f3c

Please sign in to comment.