Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Size::new const #6594

Closed
bzm3r opened this issue Nov 13, 2022 · 1 comment
Closed

Make Size::new const #6594

bzm3r opened this issue Nov 13, 2022 · 1 comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@bzm3r
Copy link
Contributor

bzm3r commented Nov 13, 2022

What problem does this solve or what need does it fill?

It is often useful to implement a const Size for a widget. But, one cannot use Size::new to define this const...

What solution would you like?

Make Size::new const.

@bzm3r bzm3r added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 13, 2022
@bzm3r bzm3r changed the title Make Size::new const. Make Size::new const Nov 13, 2022
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 13, 2022
@alice-i-cecile
Copy link
Member

In general, we should be making methods like this const wherever possible. If we're unlikely to change it in the future to make it non-const, and it can be const, it should be const IMO.

@bors bors bot closed this as completed in 6993f3c Nov 14, 2022
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this issue Dec 15, 2022
)

# Objective

Fixes bevyengine#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
alradish pushed a commit to alradish/bevy that referenced this issue Jan 22, 2023
)

# Objective

Fixes bevyengine#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
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
)

# Objective

Fixes bevyengine#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants