make vector2d new const (#383)

This commit is contained in:
Corwin 2023-01-29 19:15:14 +00:00 committed by GitHub
commit f293f8c48d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- Made Vector2D::new a const function
### Fixed ### Fixed
- Alpha channel is now considered by `include_gfx!()` even when `transparent_colour` is absent. - Alpha channel is now considered by `include_gfx!()` even when `transparent_colour` is absent.

View file

@ -980,7 +980,7 @@ impl<T: Number> Vector2D<T> {
/// assert_eq!(v.x, 1); /// assert_eq!(v.x, 1);
/// assert_eq!(v.y, 2); /// assert_eq!(v.y, 2);
/// ``` /// ```
pub fn new(x: T, y: T) -> Self { pub const fn new(x: T, y: T) -> Self {
Vector2D { x, y } Vector2D { x, y }
} }