Skip to content

Commit

Permalink
Chore: Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Jul 31, 2024
1 parent 4103ffd commit 05ee562
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ audiopus = { optional = true, version = "0.3.0-rc.0" }
byteorder = { optional = true, version = "1" }
bytes = { optional = true, version = "1" }
crypto_secretbox = { optional = true, features = ["std"], version = "0.1" }
dashmap = { optional = true, version = "5" }
dashmap = { optional = true, version = "6" }
derivative = "2"
discortp = { default-features = false, features = ["discord", "pnet", "rtp"], optional = true, version = "0.6" }
either = "1.9.0"
Expand All @@ -29,9 +29,9 @@ nohash-hasher = { optional = true, version = "0.2.0" }
parking_lot = { optional = true, version = "0.12" }
pin-project = "1"
rand = { optional = true, version = "0.8" }
reqwest = { default-features = false, features = ["stream"], optional = true, version = "0.11" }
ringbuf = { optional = true, version = "0.3" }
rubato = { optional = true, version = "0.14.1" }
reqwest = { default-features = false, features = ["stream"], optional = true, version = "0.12" }
ringbuf = { optional = true, version = "0.4" }
rubato = { optional = true, version = "0.15.0" }
rusty_pool = { optional = true, version = "0.7" }
serde = { version = "1", features = ["derive"] }
serde-aux = { optional = true, version = "4"}
Expand All @@ -43,8 +43,8 @@ streamcatcher = { optional = true, version = "1" }
symphonia = { default_features = false, optional = true, version = "0.5.2" }
symphonia-core = { optional = true, version = "0.5.2" }
tokio = { default-features = false, optional = true, version = "1.0" }
tokio-tungstenite = { optional = true, version = "0.21" }
tokio-websockets = { optional = true, version = "0.7", features = ["client", "fastrand", "sha1_smol", "simd"] }
tokio-tungstenite = { optional = true, version = "0.23", features = ["url"] }
tokio-websockets = { optional = true, version = "0.8", features = ["client", "fastrand", "sha1_smol", "simd"] }
tokio-util = { features = ["io"], optional = true, version = "0.7" }
tracing = { version = "0.1", features = ["log"] }
tracing-futures = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/driver/tasks/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ fn ws_error_is_not_final(err: &WsError) -> bool {
_ => true,
},
#[cfg(feature = "tws")]
WsError::WsClosed(Some(code)) => match (*code).into() {
WsError::WsClosed(Some(frame)) => match frame.code.into() {
code @ 4000..=4999_u16 =>
if let Some(code) = VoiceCloseCode::from_u16(code) {
code.should_resume()
Expand Down
2 changes: 1 addition & 1 deletion src/events/context/data/disconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl From<&WsError> for DisconnectReason {
_ => None,
},
#[cfg(feature = "tws")]
WsError::WsClosed(Some(code)) => match (*code).into() {
WsError::WsClosed(Some(frame)) => match frame.code.into() {
code @ 4000..=4999_u16 => VoiceCloseCode::from_u16(code),
_ => None,
},
Expand Down
15 changes: 11 additions & 4 deletions src/input/adapters/async_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ use crate::input::AudioStreamError;
use async_trait::async_trait;
use flume::{Receiver, RecvError, Sender, TryRecvError};
use futures::{future::Either, stream::FuturesUnordered, FutureExt, StreamExt};
use ringbuf::*;
use ringbuf::{
traits::{Consumer, Observer, Split},
HeapCons,
HeapProd,
SharedRb,
};
use std::{
io::{
Error as IoError,
Expand All @@ -25,7 +30,7 @@ use tokio::{
};

struct AsyncAdapterSink {
bytes_in: HeapProducer<u8>,
bytes_in: HeapProd<u8>,
req_rx: Receiver<AdapterRequest>,
resp_tx: Sender<AdapterResponse>,
stream: Box<dyn AsyncMediaSource>,
Expand Down Expand Up @@ -136,7 +141,7 @@ impl AsyncAdapterSink {
/// pass along seek requests needed. This allows for passing bytes from exclusively `AsyncRead`
/// streams (e.g., hyper HTTP sessions) to Songbird.
pub struct AsyncAdapterStream {
bytes_out: HeapConsumer<u8>,
bytes_out: HeapCons<u8>,
can_seek: bool,
// Note: these are Atomic just to work around the need for
// check_messages to take &self rather than &mut.
Expand All @@ -147,6 +152,8 @@ pub struct AsyncAdapterStream {
notify_tx: Arc<Notify>,
}

unsafe impl Sync for AsyncAdapterStream {}

impl AsyncAdapterStream {
/// Wrap and pull from an async file stream, with an intermediate ring-buffer of size `buf_len`
/// between the async and sync halves.
Expand Down Expand Up @@ -278,7 +285,7 @@ impl Seek for AsyncAdapterStream {
_ => unreachable!(),
}

self.bytes_out.skip(self.bytes_out.capacity());
self.bytes_out.skip(self.bytes_out.capacity().into());

_ = self.req_tx.send(AdapterRequest::SeekCleared);

Expand Down

0 comments on commit 05ee562

Please sign in to comment.