From 1d5b25965b48f156e1ca37a3772ad8ea47417f1c Mon Sep 17 00:00:00 2001 From: Alvaro <62391364+AlvaroMS25@users.noreply.github.com> Date: Sat, 30 Mar 2024 13:14:24 +0100 Subject: [PATCH] Make DisposalThread reachable (#235) The `Config` object provided to `Call`s and `Driver`s allows setting a `DisposalThread`, but since it is unreachable from outside the crate, the only way to properly set it is using a `Songbird` instance, which may not be adequate for all use cases. This PR just makes `DisposalThread` reachable from the outside. --- src/driver/mod.rs | 2 ++ src/driver/tasks/disposal.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/driver/mod.rs b/src/driver/mod.rs index 3e5b58b..ba98ca1 100644 --- a/src/driver/mod.rs +++ b/src/driver/mod.rs @@ -64,6 +64,8 @@ use core::{ use flume::{r#async::RecvFut, SendError, Sender}; #[cfg(feature = "builtin-queue")] use std::time::Duration; +#[allow(unused_imports)] +pub use tasks::disposal::DisposalThread; use tasks::message::CoreMessage; use tracing::instrument; diff --git a/src/driver/tasks/disposal.rs b/src/driver/tasks/disposal.rs index 448f4e5..707b87f 100644 --- a/src/driver/tasks/disposal.rs +++ b/src/driver/tasks/disposal.rs @@ -12,6 +12,7 @@ impl Default for DisposalThread { } impl DisposalThread { + #[must_use] pub fn run() -> Self { let (mix_tx, mix_rx) = flume::unbounded(); std::thread::spawn(move || {