We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b148484 commit b481980Copy full SHA for b481980
1 file changed
src/lib.rs
@@ -50,6 +50,13 @@ impl Emitter {
50
51
let callbacks = self.callbacks.clone();
52
let mut listeners_rx = self.listeners_tx.subscribe();
53
+ let mut watch_stream = match nusb::watch_devices() {
54
+ Ok(watch_stream) => watch_stream,
55
+ Err(e) => {
56
+ self.initialized.store(false, Ordering::Release);
57
+ return Err(napi::Error::from_reason(format!("init error: {e}")));
58
+ }
59
+ };
60
61
tokio::spawn(async move {
62
loop {
@@ -58,10 +65,6 @@ impl Emitter {
65
return;
66
}
67
- let mut watch_stream = match nusb::watch_devices() {
- Ok(watch_stream) => watch_stream,
63
- Err(_) => return,
64
- };
68
69
tokio::select! {
70
_ = listeners_rx.changed() => {
0 commit comments