summaryrefslogtreecommitdiffstats
path: root/core/src/keyboard
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 13:31:02 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 13:31:02 +0100
commit03f5a351c37dbe1b0a286583e620d1cf074f1b91 (patch)
tree8cd9894a0a7d83664fd662de0533df21b481c397 /core/src/keyboard
parent64d1ce5532f55d152fa5819532a138da2dca1a39 (diff)
downloadiced-03f5a351c37dbe1b0a286583e620d1cf074f1b91.tar.gz
iced-03f5a351c37dbe1b0a286583e620d1cf074f1b91.tar.bz2
iced-03f5a351c37dbe1b0a286583e620d1cf074f1b91.zip
Use `SmolStr` for `text` field in `KeyPressed` event
Diffstat (limited to 'core/src/keyboard')
-rw-r--r--core/src/keyboard/event.rs3
-rw-r--r--core/src/keyboard/key.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/core/src/keyboard/event.rs b/core/src/keyboard/event.rs
index b1792415..1eb42334 100644
--- a/core/src/keyboard/event.rs
+++ b/core/src/keyboard/event.rs
@@ -1,4 +1,5 @@
use crate::keyboard::{Key, Location, Modifiers};
+use crate::SmolStr;
/// A keyboard event.
///
@@ -20,7 +21,7 @@ pub enum Event {
modifiers: Modifiers,
/// The text produced by the key press, if any.
- text: Option<String>,
+ text: Option<SmolStr>,
},
/// A keyboard key was released.
diff --git a/core/src/keyboard/key.rs b/core/src/keyboard/key.rs
index ef48dae4..dbde5196 100644
--- a/core/src/keyboard/key.rs
+++ b/core/src/keyboard/key.rs
@@ -1,5 +1,5 @@
//! Identify keyboard keys.
-use smol_str::SmolStr;
+use crate::SmolStr;
/// A key on the keyboard.
///