bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Constify `Rect`

Open ickshonpe opened this issue 1 month ago • 2 comments

Objective

None of Rect's methods are const, but they can be.

Solution

Make them const.

Testing

The tests in the rect module still pass.

ickshonpe avatar Nov 21 '25 16:11 ickshonpe

Realised this might be stupid, glam's functions aren't const because of all the simd optimisations? I'm not sure though, Rect isn't normally used in such a way that makes those kind of optimisations meaningful.

ickshonpe avatar Nov 21 '25 17:11 ickshonpe

I don't see a downside to this, you never know when someone might need a part of code to be const. Looks good to me

Demonagon avatar Dec 01 '25 12:12 Demonagon