Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove wrapping Result #103

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub struct GlobalHotKeyManager {
impl GlobalHotKeyManager {
pub fn new() -> crate::Result<Self> {
Ok(Self {
platform_impl: platform_impl::GlobalHotKeyManager::new()?,
platform_impl: platform_impl::GlobalHotKeyManager::new(),
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/x11/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ pub struct GlobalHotKeyManager {
}

impl GlobalHotKeyManager {
pub fn new() -> crate::Result<Self> {
pub fn new() -> Self {
let (thread_tx, thread_rx) = unbounded();
std::thread::spawn(|| events_processor(thread_rx));
Ok(Self { thread_tx })
Self { thread_tx }
}
Comment on lines +29 to 33
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Result here appears unnecessary and used.

This shouldn't cause any external changes. The goal is to make the API a bit cleaner.


pub fn register(&self, hotkey: HotKey) -> crate::Result<()> {
Expand Down
Loading