mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-04 07:11:28 +03:00
support for cmdline args and better error handling (#4)
* support for cmdline args and better error handling * make config.toml optional * dont abuse panic for error handling * update doc * more panics removed * more unwraps removed
This commit is contained in:
committed by
GitHub
parent
deb1548e21
commit
a2d2e904f8
@@ -1,6 +1,6 @@
|
||||
#[cfg(unix)]
|
||||
use std::env;
|
||||
use std::{thread::{JoinHandle, self}, sync::mpsc::SyncSender};
|
||||
use std::{thread::{JoinHandle, self}, sync::mpsc::SyncSender, error::Error};
|
||||
|
||||
use crate::{client::{Client, ClientHandle}, event::Event, request::Server};
|
||||
|
||||
@@ -16,8 +16,8 @@ pub fn start(
|
||||
produce_tx: SyncSender<(Event, ClientHandle)>,
|
||||
clients: Vec<Client>,
|
||||
request_server: Server,
|
||||
) -> JoinHandle<()> {
|
||||
thread::Builder::new()
|
||||
) -> Result<JoinHandle<()>, Box<dyn Error>> {
|
||||
Ok(thread::Builder::new()
|
||||
.name("event producer".into())
|
||||
.spawn(move || {
|
||||
#[cfg(windows)]
|
||||
@@ -48,6 +48,5 @@ pub fn start(
|
||||
producer::wayland::run(produce_tx, request_server, clients);
|
||||
}
|
||||
}
|
||||
})
|
||||
.unwrap()
|
||||
})?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user