Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienDeepgram committed Jul 25, 2024
1 parent 77f0a47 commit ff7a6cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/transcription/websocket/simple_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -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()
Expand All @@ -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())
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use core::fmt;
use std::io;
use std::ops::Deref;

use futures::channel::mpsc;
use reqwest::{
header::{HeaderMap, HeaderValue},
RequestBuilder,
Expand Down Expand Up @@ -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")]
Expand Down
5 changes: 4 additions & 1 deletion src/listen/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ff7a6cc

Please sign in to comment.