-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Constructing Key::Character(_) without importing Smolstr #2996
Copy link
Copy link
Closed
Description
Currently to construct a Key::Character(_) I have to:
- Import
Smolstr - Do e.g.
Key::Character(SmolStr::new_inline("/"))
Since Winit includes Smolstr in its public API, I recommend that it be publically re-export (e.g. winit::keyboard::Smolstr) so that users do not have to add a dependency on (the correct version of) this crate too.
Further, I suggest adding convenience constructors. Some ideas:
-fn Key::new_char(c: char) -> Option<Self> — note that control characters are not allowed
fn Key::new_str(s: impl AsRef<str>) -> Option<Self>fn Key::new_str_inline(s: &str) -> Option<Self>— usesSmolStr::new_inline
Since Key::Character is not a char maybe it has the wrong name? (I bet there's already far too much discussion on that topic.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels