diff options
-rw-r--r-- | core/src/keyboard/event.rs | 3 | ||||
-rw-r--r-- | core/src/keyboard/key.rs | 2 | ||||
-rw-r--r-- | core/src/lib.rs | 2 | ||||
-rw-r--r-- | winit/src/conversion.rs | 4 |
4 files changed, 6 insertions, 5 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. /// diff --git a/core/src/lib.rs b/core/src/lib.rs index 54ea5839..864df6e6 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -75,3 +75,5 @@ pub use size::Size; pub use text::Text; pub use vector::Vector; pub use widget::Widget; + +pub use smol_str::SmolStr; diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 387289e8..90a5d27f 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -225,9 +225,7 @@ pub fn window_event( key, modifiers, location, - text: text - .as_ref() - .map(winit::keyboard::SmolStr::to_string), + text, } } winit::event::ElementState::Released => { |