Make many functions const

The point is to set up repeated components or boilerplate before their
use sites.

The majority of these make sense as `const`. However, some functions
such as those regarding state may not make sense as `const`.
This commit is contained in:
Nikolai Vazquez 2019-11-29 21:24:52 -05:00
parent 811d8b90d7
commit 267e242238
16 changed files with 60 additions and 57 deletions

View file

@ -16,7 +16,7 @@ impl<T> Vector<T> {
/// Creates a new [`Vector`] with the given components.
///
/// [`Vector`]: struct.Vector.html
pub fn new(x: T, y: T) -> Self {
pub const fn new(x: T, y: T) -> Self {
Self { x, y }
}
}