KeyboardShortcut: Use Display for platform string#10833
Open
LeonMatthes wants to merge 1 commit intoslint-ui:masterfrom
Open
KeyboardShortcut: Use Display for platform string#10833LeonMatthes wants to merge 1 commit intoslint-ui:masterfrom
LeonMatthes wants to merge 1 commit intoslint-ui:masterfrom
Conversation
tronical
reviewed
Feb 20, 2026
internal/core/input.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl From<KeyboardShortcut> for SharedString { |
Member
There was a problem hiding this comment.
If you want to minimise special casing, then I think the existing slint::ToSharedString trait would be a legit replacement. The implementation is identical, but it will require slightly different gymnastics at the use-sites.
What do you think?
Collaborator
Author
There was a problem hiding this comment.
Aha, ToSharedString should already automatically implemented for anything that implements Display, so I should just be able to remove this, nice 👍
7c8484a to
c3b3b83
Compare
tronical
reviewed
Feb 20, 2026
internal/core/input.rs
Outdated
| out: &mut SharedString, | ||
| ) { | ||
| *out = shortcut.to_platform_string(); | ||
| *out = crate::format!("{shortcut}"); |
Member
There was a problem hiding this comment.
Or perhaps just *out = shortcut.to_shared_string();? :)
c3b3b83 to
81c03b8
Compare
tronical
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up on #10828