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/text_input.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/src/widget/text_input.rs') diff --git a/web/src/widget/text_input.rs b/web/src/widget/text_input.rs index d6357512..04c3b287 100644 --- a/web/src/widget/text_input.rs +++ b/web/src/widget/text_input.rs @@ -191,7 +191,7 @@ impl State { /// Creates a new [`State`], representing an unfocused [`TextInput`]. /// /// [`State`]: struct.State.html - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self } } -- cgit