-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid panic when parsing invalid hotkey string (#61)
- Loading branch information
Showing
3 changed files
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"global-hotkey": "minor" | ||
--- | ||
|
||
Refactored the errors when parsing accelerator from string: | ||
|
||
- Added `HotKeyParseError` error enum. | ||
- Removed `Error::UnrecognizedHotKeyCode` enum variant | ||
- Removed `Error::EmptyHotKeyToken` enum variant | ||
- Removed `Error::UnexpectedHotKeyFormat` enum variant | ||
- Changed `Error::HotKeyParseError` inner value from `String` to the newly added `HotKeyParseError` enum. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"global-hotkey": "patch" | ||
--- | ||
|
||
Avoid panicing when parsing an invalid `HotKey` from a string such as `SHIFT+SHIFT` and return an error instead. |
This file contains 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