Feat: cleanup
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
//! Audio output stream (cpal) and FFT spectrum analysis.
|
||||
|
||||
use ringbuf::{traits::*, HeapRb};
|
||||
use rustfft::{num_complex::Complex, FftPlanner};
|
||||
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
|
||||
@@ -173,8 +175,8 @@ impl SpectrumAnalyzer {
|
||||
|
||||
pub struct AnalysisHandle {
|
||||
running: Arc<AtomicBool>,
|
||||
#[allow(dead_code)]
|
||||
thread: Option<JoinHandle<()>>,
|
||||
// Held to keep the thread alive until this handle is dropped.
|
||||
_thread: Option<JoinHandle<()>>,
|
||||
}
|
||||
|
||||
impl Drop for AnalysisHandle {
|
||||
@@ -202,7 +204,7 @@ pub fn spawn_analysis_thread(
|
||||
|
||||
let handle = AnalysisHandle {
|
||||
running,
|
||||
thread: Some(thread),
|
||||
_thread: Some(thread),
|
||||
};
|
||||
|
||||
(producer, handle)
|
||||
|
||||
Reference in New Issue
Block a user