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`. --- web/src/widget/slider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/src/widget/slider.rs') diff --git a/web/src/widget/slider.rs b/web/src/widget/slider.rs index 5b203e07..55848084 100644 --- a/web/src/widget/slider.rs +++ b/web/src/widget/slider.rs @@ -147,7 +147,7 @@ impl State { /// Creates a new [`State`]. /// /// [`State`]: struct.State.html - pub fn new() -> Self { + pub const fn new() -> Self { Self } } -- cgit