From f5716c48f55e666496af47c7cfb4676ba5451a66 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 19 Oct 2022 10:28:18 -0500 Subject: [PATCH] Fix type mismatches after speech-dispatcher update. --- src/backends/speech_dispatcher.rs | 10 +++++----- src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backends/speech_dispatcher.rs b/src/backends/speech_dispatcher.rs index b3034a1..7abc05a 100644 --- a/src/backends/speech_dispatcher.rs +++ b/src/backends/speech_dispatcher.rs @@ -12,8 +12,8 @@ use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS}; pub(crate) struct SpeechDispatcher(Connection); lazy_static! { - static ref SPEAKING: Mutex> = { - let m: HashMap = HashMap::new(); + static ref SPEAKING: Mutex> = { + let m: HashMap = HashMap::new(); Mutex::new(m) }; } @@ -31,7 +31,7 @@ impl SpeechDispatcher { let mut callbacks = CALLBACKS.lock().unwrap(); let backend_id = BackendId::SpeechDispatcher(client_id); let cb = callbacks.get_mut(&backend_id).unwrap(); - let utterance_id = UtteranceId::SpeechDispatcher(msg_id); + let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64); if let Some(f) = cb.utterance_begin.as_mut() { f(utterance_id); } @@ -42,7 +42,7 @@ impl SpeechDispatcher { let mut callbacks = CALLBACKS.lock().unwrap(); let backend_id = BackendId::SpeechDispatcher(client_id); let cb = callbacks.get_mut(&backend_id).unwrap(); - let utterance_id = UtteranceId::SpeechDispatcher(msg_id); + let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64); if let Some(f) = cb.utterance_end.as_mut() { f(utterance_id); } @@ -53,7 +53,7 @@ impl SpeechDispatcher { let mut callbacks = CALLBACKS.lock().unwrap(); let backend_id = BackendId::SpeechDispatcher(client_id); let cb = callbacks.get_mut(&backend_id).unwrap(); - let utterance_id = UtteranceId::SpeechDispatcher(msg_id); + let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64); if let Some(f) = cb.utterance_stop.as_mut() { f(utterance_id); } diff --git a/src/lib.rs b/src/lib.rs index 8a8df57..86dcbd9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,7 +84,7 @@ pub enum BackendId { #[cfg(any(target_os = "macos", target_os = "ios"))] AvFoundation(u64), #[cfg(target_os = "linux")] - SpeechDispatcher(u64), + SpeechDispatcher(usize), #[cfg(target_arch = "wasm32")] Web(u64), #[cfg(windows)]