From 267e242238fab0aba14fb4c2e27269ce3a3e3951 Mon Sep 17 00:00:00 2001 From: Nikolai Vazquez Date: Fri, 29 Nov 2019 21:24:52 -0500 Subject: 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`. --- native/src/widget/image.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/widget/image.rs') diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs index 4c588c9d..5cfe074f 100644 --- a/native/src/widget/image.rs +++ b/native/src/widget/image.rs @@ -37,7 +37,7 @@ impl Image { /// Sets the width of the [`Image`] boundaries. /// /// [`Image`]: struct.Image.html - pub fn width(mut self, width: Length) -> Self { + pub const fn width(mut self, width: Length) -> Self { self.width = width; self } @@ -45,7 +45,7 @@ impl Image { /// Sets the height of the [`Image`] boundaries. /// /// [`Image`]: struct.Image.html - pub fn height(mut self, height: Length) -> Self { + pub const fn height(mut self, height: Length) -> Self { self.height = height; self } -- cgit