summaryrefslogtreecommitdiffstats
path: root/native/src/layout
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-03-06 03:47:40 +0100
committerLibravatar GitHub <noreply@github.com>2020-03-06 03:47:40 +0100
commitd817fe8e144e8d81979d8f8c8dfb95da8b28e3e9 (patch)
treee8d336f35bc9e747f6d6a65d8c751ed261566e98 /native/src/layout
parent3062c190bbcc82f30eaabc086a4e5014e320c8b6 (diff)
parentf81827c151eba868ab17f35d21a654d48125d0bf (diff)
downloadiced-d817fe8e144e8d81979d8f8c8dfb95da8b28e3e9.tar.gz
iced-d817fe8e144e8d81979d8f8c8dfb95da8b28e3e9.tar.bz2
iced-d817fe8e144e8d81979d8f8c8dfb95da8b28e3e9.zip
Merge pull request #91 from nvzqz/const-all-the-things
Make many functions `const`
Diffstat (limited to 'native/src/layout')
-rw-r--r--native/src/layout/limits.rs2
-rw-r--r--native/src/layout/node.rs4
2 files changed, 3 insertions, 3 deletions
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<Node>) -> Self {
+ pub const fn with_children(size: Size, children: Vec<Node>) -> Self {
Node {
bounds: Rectangle {
x: 0.0,