From f81827c151eba868ab17f35d21a654d48125d0bf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 6 Mar 2020 03:30:48 +0100 Subject: Remove counterintuitive constant functions --- native/src/widget/text_input.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'native/src/widget/text_input.rs') diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 0246f0d5..f97ed424 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -326,17 +326,14 @@ impl State { /// Creates a new [`State`], representing an unfocused [`TextInput`]. /// /// [`State`]: struct.State.html - pub const fn new() -> Self { - Self { - is_focused: false, - cursor_position: 0, - } + pub fn new() -> Self { + Self::default() } /// Creates a new [`State`], representing a focused [`TextInput`]. /// /// [`State`]: struct.State.html - pub const fn focused() -> Self { + pub fn focused() -> Self { use std::usize; Self { @@ -348,7 +345,7 @@ impl State { /// Returns whether the [`TextInput`] is currently focused or not. /// /// [`TextInput`]: struct.TextInput.html - pub const fn is_focused(&self) -> bool { + pub fn is_focused(&self) -> bool { self.is_focused } -- cgit