diff --git a/core/src/vector.rs b/core/src/vector.rs index 1c09ee3e..4c1cbfab 100644 --- a/core/src/vector.rs +++ b/core/src/vector.rs @@ -16,7 +16,7 @@ impl Vector { /// 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 } } } diff --git a/native/src/layout/limits.rs b/native/src/layout/limits.rs index b674b58a..664c881a 100644 --- a/native/src/layout/limits.rs +++ b/native/src/layout/limits.rs @@ -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, diff --git a/native/src/layout/node.rs b/native/src/layout/node.rs index 11e93b72..a265c46a 100644 --- a/native/src/layout/node.rs +++ b/native/src/layout/node.rs @@ -12,7 +12,7 @@ impl Node { /// /// [`Node`]: struct.Node.html /// [`Size`]: ../struct.Size.html - pub fn new(size: Size) -> Self { + pub const fn new(size: Size) -> Self { Self::with_children(size, Vec::new()) } @@ -20,7 +20,7 @@ impl Node { /// /// [`Node`]: struct.Node.html /// [`Size`]: ../struct.Size.html - pub fn with_children(size: Size, children: Vec) -> Self { + pub const fn with_children(size: Size, children: Vec) -> Self { Node { bounds: Rectangle { x: 0.0,