make vector2d new const

This commit is contained in:
Corwin 2023-01-29 19:04:25 +00:00
parent 64bd1ad7dd
commit f0dd544394

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 }
} }