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:
parent
811d8b90d7
commit
267e242238
16 changed files with 60 additions and 57 deletions
|
|
@ -20,7 +20,7 @@ impl Limits {
|
|||
///
|
||||
/// [`Limits`]: struct.Limits.html
|
||||
/// [`Size`]: ../struct.Size.html
|
||||
pub fn new(min: Size, max: Size) -> Limits {
|
||||
pub const fn new(min: Size, max: Size) -> Limits {
|
||||
Limits {
|
||||
min,
|
||||
max,
|
||||
|
|
@ -32,7 +32,7 @@ impl Limits {
|
|||
///
|
||||
/// [`Limits`]: struct.Limits.html
|
||||
/// [`Size`]: ../struct.Size.html
|
||||
pub fn min(&self) -> Size {
|
||||
pub const fn min(&self) -> Size {
|
||||
self.min
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ impl Limits {
|
|||
///
|
||||
/// [`Limits`]: struct.Limits.html
|
||||
/// [`Size`]: ../struct.Size.html
|
||||
pub fn max(&self) -> Size {
|
||||
pub const fn max(&self) -> Size {
|
||||
self.max
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue