From ff7a6cc9932ba233a957bff554ca9d5aed572298 Mon Sep 17 00:00:00 2001 From: Damien Murphy Date: Wed, 24 Jul 2024 22:26:29 -0700 Subject: [PATCH] Fix build errors --- examples/transcription/websocket/simple_stream.rs | 8 ++++---- src/lib.rs | 3 +-- src/listen/websocket.rs | 5 ++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/transcription/websocket/simple_stream.rs b/examples/transcription/websocket/simple_stream.rs index 6370e71d..198711f0 100644 --- a/examples/transcription/websocket/simple_stream.rs +++ b/examples/transcription/websocket/simple_stream.rs @@ -4,8 +4,8 @@ use std::time::Duration; use tokio::sync::mpsc; use deepgram::{ - common::options::{Encoding, Endpointing, Language, Model, Options}, - listen::websocket::Event, + common::options::{Encoding, Endpointing, Language, Model, Options}, + listen::websocket::Event, Deepgram, DeepgramError, }; @@ -36,7 +36,7 @@ async fn main() -> Result<(), DeepgramError> { } }); - let (connection, mut response_stream) = dg + let (_connection, mut response_stream) = dg .transcription() .stream_request_with_options(Some(&options)) .keep_alive() @@ -52,7 +52,7 @@ async fn main() -> Result<(), DeepgramError> { PATH_TO_FILE, AUDIO_CHUNK_SIZE, Duration::from_millis(16), - event_tx.clone() + event_tx.clone(), ) .await? .start(event_tx.clone()) diff --git a/src/lib.rs b/src/lib.rs index d923c3fd..6b353d49 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,6 @@ use core::fmt; use std::io; use std::ops::Deref; -use futures::channel::mpsc; use reqwest::{ header::{HeaderMap, HeaderValue}, RequestBuilder, @@ -156,7 +155,7 @@ pub enum DeepgramError { /// Something went wrong with sending #[cfg(feature = "listen")] #[error("Something went wrong with WS: {0}")] - SendError(#[from] mpsc::SendError), + SendError(#[from] futures::channel::mpsc::SendError), /// Something went wrong with receiving #[cfg(feature = "listen")] diff --git a/src/listen/websocket.rs b/src/listen/websocket.rs index 180bf03c..9a03a455 100644 --- a/src/listen/websocket.rs +++ b/src/listen/websocket.rs @@ -425,7 +425,10 @@ where Err(e) => { println!("Error receiving from source: {:?}", e); let _ = event_tx_send - .send(Event::Error(DeepgramError::CustomError(format!("{:?}", e)))) + .send(Event::Error(DeepgramError::CustomError(format!( + "{:?}", + e + )))) .await; break; }