summaryrefslogtreecommitdiffstats
path: root/native/src/widget/text_input.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-06 03:30:48 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-06 03:30:48 +0100
commitf81827c151eba868ab17f35d21a654d48125d0bf (patch)
tree6b844fb33fb83dfd61dbb89512fff2b766e4bff5 /native/src/widget/text_input.rs
parent267e242238fab0aba14fb4c2e27269ce3a3e3951 (diff)
downloadiced-f81827c151eba868ab17f35d21a654d48125d0bf.tar.gz
iced-f81827c151eba868ab17f35d21a654d48125d0bf.tar.bz2
iced-f81827c151eba868ab17f35d21a654d48125d0bf.zip
Remove counterintuitive constant functions
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r--native/src/widget/text_input.rs11
1 files changed, 4 insertions, 7 deletions
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
}