warning: unused import: `atomic::Ordering`
--> src/audio/buffer.rs:6:18
|
6 | use std::{sync::{atomic::Ordering, Arc, Mutex}, time::Duration};
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `futures::channel::oneshot`
--> src/audio/commands.rs:6:5
|
6 | use futures::channel::oneshot; // Used for acknowledging commands
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `InputDevices` and `OutputDevices`
--> src/audio/device.rs:3:26
|
3 | use cpal::{Device, Host, InputDevices, OutputDevices, SupportedStreamConfig, SupportedStreamConfigRange};
| ^^^^^^^^^^^^ ^^^^^^^^^^^^^
warning: unused import: `error`
--> src/audio/device_manager.rs:15:22
|
15 | use tracing::{debug, error, info, instrument, trace, warn};
| ^^^^^
warning: unused import: `Ordering`
--> src/audio/stream_manager.rs:1:62
|
1 | use std::sync::{Arc, Mutex as StdMutex, atomic::{AtomicBool, Ordering}};
| ^^^^^^^^
warning: unused imports: `AudioStreamError` and `AudioStreamManager`
--> src/audio/mod.rs:17:26
|
17 | pub use stream_manager::{AudioStreamManager, AudioStreamError};
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
warning: unused import: `Modifiers`
--> src/hotkey_service.rs:8:22
|
8 | hotkey::{HotKey, Modifiers},
| ^^^^^^^^^
warning: unused import: `tokio::sync::mpsc`
--> src/hotkey_service.rs:12:5
|
12 | use tokio::sync::mpsc;
| ^^^^^^^^^^^^^^^^^
warning: unused import: `oneshot`
--> src/shutdown_handler.rs:6:30
|
6 | use tokio::sync::{broadcast, oneshot};
| ^^^^^^^
warning: unused import: `tokio::task::JoinHandle`
--> src/shutdown_handler.rs:7:5
|
7 | use tokio::task::JoinHandle;
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: variable does not need to be mutable
--> src/transcription/mod.rs:96:13
|
96 | let mut chunks = chunking_manager.add_samples(&chunk);
| ----^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: unused variable: `host`
--> src/audio/device.rs:118:28
|
118 | pub fn select_audio_device(host: &Host) -> Result<Arc<AudioDevice>> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_host`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `host`
--> src/audio/device.rs:141:28
|
141 | pub fn find_device_by_name(host: &Host, name: &str) -> Result<Arc<AudioDevice>> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_host`
warning: unused variable: `config`
--> src/audio/device_manager.rs:135:13
|
135 | let config = cpal::StreamConfig {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_config`
warning: constant `BUFFER_SIZE` is never used
--> src/audio/buffer.rs:13:11
|
13 | pub const BUFFER_SIZE: u32 = 1024;
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: constant `CHANNELS` is never used
--> src/audio/buffer.rs:14:11
|
14 | pub const CHANNELS: u16 = 1;
| ^^^^^^^^
warning: constant `CHUNK_DURATION_MS` is never used
--> src/audio/buffer.rs:15:11
|
15 | pub const CHUNK_DURATION_MS: u64 = 5000;
| ^^^^^^^^^^^^^^^^^
warning: constant `CHUNK_SIZE` is never used
--> src/audio/buffer.rs:16:11
|
16 | pub const CHUNK_SIZE: usize =
| ^^^^^^^^^^
warning: fields `samples`, `recording_state`, and `required_samples` are never read
--> src/audio/buffer.rs:26:5
|
24 | pub struct AudioBuffer {
| ----------- fields in this struct
25 | /// The actual audio samples
26 | samples: Vec<f32>,
| ^^^^^^^
27 | /// Current recording state (active/inactive)
28 | recording_state: RecordingState,
| ^^^^^^^^^^^^^^^
29 | /// Number of samples needed for a complete chunk
30 | required_samples: usize,
| ^^^^^^^^^^^^^^^^
|
= note: `AudioBuffer` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: multiple methods are never used
--> src/audio/buffer.rs:44:12
|
33 | impl AudioBuffer {
| ---------------- methods in this implementation
...
44 | pub fn is_active(&self) -> bool {
| ^^^^^^^^^
...
49 | pub fn append_samples(&mut self, samples: &[f32]) {
| ^^^^^^^^^^^^^^
...
57 | pub fn get_complete_chunk(&mut self) -> Option<Vec<f32>> {
| ^^^^^^^^^^^^^^^^^^
...
66 | pub fn take_remaining(&mut self) -> Vec<f32> {
| ^^^^^^^^^^^^^^
...
71 | pub fn has_complete_chunk(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^
...
76 | pub fn current_duration(&self) -> f32 {
| ^^^^^^^^^^^^^^^^
...
81 | pub fn stop_recording(&mut self) {
| ^^^^^^^^^^^^^^
...
86 | pub fn start_recording(&mut self) {
| ^^^^^^^^^^^^^^^
...
92 | pub fn clear(&mut self) {
| ^^^^^
...
97 | pub fn samples(&self) -> &[f32] {
| ^^^^^^^
...
102 | pub fn recording_state(&self) -> &RecordingState {
| ^^^^^^^^^^^^^^^
warning: function `create_shared_buffer` is never used
--> src/audio/buffer.rs:108:8
|
108 | pub fn create_shared_buffer(
| ^^^^^^^^^^^^^^^^^^^^
warning: function `try_lock_buffer` is never used
--> src/audio/buffer.rs:117:8
|
117 | pub fn try_lock_buffer(
| ^^^^^^^^^^^^^^^
warning: variants `Recording`, `Paused`, `Stopped`, and `Error` are never constructed
--> src/audio/commands.rs:29:5
|
27 | pub enum AudioStreamStatus {
| ----------------- variants in this enum
28 | /// The stream is actively recording audio.
29 | Recording,
| ^^^^^^^^^
30 | /// The stream is paused.
31 | Paused,
| ^^^^^^
32 | /// The stream is stopped or not yet started.
33 | Stopped,
| ^^^^^^^
34 | /// The stream encountered an unrecoverable error.
35 | Error(String),
| ^^^^^
|
= note: `AudioStreamStatus` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: multiple variants are never constructed
--> src/audio/commands.rs:42:5
|
40 | pub enum AudioError {
| ---------- variants in this enum
41 | #[error("Device error: {0}")]
42 | DeviceError(String),
| ^^^^^^^^^^^
...
54 | CommandSendError(String),
| ^^^^^^^^^^^^^^^^
...
57 | ConfigError(String),
| ^^^^^^^^^^^
...
60 | ProcessingError(String),
| ^^^^^^^^^^^^^^^
...
66 | NoDefaultDevice,
| ^^^^^^^^^^^^^^^
...
69 | DeviceNotFound(String),
| ^^^^^^^^^^^^^^
...
72 | UnsupportedConfig(String),
| ^^^^^^^^^^^^^^^^^
...
75 | BufferError(String),
| ^^^^^^^^^^^
...
78 | FeatureNotSupported(String),
| ^^^^^^^^^^^^^^^^^^^
...
81 | InitializationFailed(String),
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `AudioError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field `cpal_device` is never read
--> src/audio/device.rs:14:9
|
12 | pub struct AudioDevice {
| ----------- field in this struct
13 | pub name: String,
14 | pub cpal_device: Device, // Store the actual cpal::Device
| ^^^^^^^^^^^
|
= note: `AudioDevice` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
warning: associated items `name`, `is_input`, `default_input`, `default_output`, and `list_output_devices` are never used
--> src/audio/device.rs:24:12
|
19 | impl AudioDevice {
| ---------------- associated items in this implementation
...
24 | pub fn name(&self) -> String {
| ^^^^
...
28 | pub fn is_input(&self) -> bool {
| ^^^^^^^^
...
42 | pub fn default_input() -> Result<Arc<Self>> {
| ^^^^^^^^^^^^^
...
51 | pub fn default_output() -> Result<Arc<Self>> {
| ^^^^^^^^^^^^^^
...
66 | pub fn list_output_devices() -> Result<Vec<Arc<Self>>> {
| ^^^^^^^^^^^^^^^^^^^
warning: function `get_device_capabilities` is never used
--> src/audio/device.rs:160:8
|
160 | pub fn get_device_capabilities(device: &Device) -> Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: function `append_configs` is never used
--> src/audio/device.rs:174:4
|
174 | fn append_configs(
| ^^^^^^^^^^^^^^
warning: function `list_audio_devices` is never used
--> src/audio/device.rs:212:8
|
212 | pub fn list_audio_devices() -> Result<Vec<Arc<AudioDevice>>> {
| ^^^^^^^^^^^^^^^^^^
warning: struct `AudioDeviceManager` is never constructed
--> src/audio/device_manager.rs:18:12
|
18 | pub struct AudioDeviceManager {
| ^^^^^^^^^^^^^^^^^^
warning: fields `device` and `device_config` are never read
--> src/audio/stream.rs:21:9
|
20 | pub struct AudioStream {
| ----------- fields in this struct
21 | pub device: Arc<AudioDevice>,
| ^^^^^^
22 | pub device_config: cpal::SupportedStreamConfig,
| ^^^^^^^^^^^^^
|
= note: `AudioStream` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
warning: method `is_disconnected` is never used
--> src/audio/stream.rs:137:12
|
33 | impl AudioStream {
| ---------------- method in this implementation
...
137 | pub fn is_disconnected(&self) -> bool {
| ^^^^^^^^^^^^^^^
warning: constant `CHANNELS` is never used
--> src/audio/constants.rs:13:11
|
13 | pub const CHANNELS: u16 = 1;
| ^^^^^^^^
warning: constant `BUFFER_SIZE` is never used
--> src/audio/constants.rs:16:11
|
16 | pub const BUFFER_SIZE: usize = (SAMPLE_RATE as u64 * CHUNK_DURATION_MS / 1000) as usize;
| ^^^^^^^^^^^
warning: constant `DEVICE_SCAN_INTERVAL` is never used
--> src/audio/constants.rs:19:11
|
19 | pub const DEVICE_SCAN_INTERVAL: u64 = 5;
| ^^^^^^^^^^^^^^^^^^^^
warning: constant `PROVIDER_CHECK_INTERVAL` is never used
--> src/audio/constants.rs:22:11
|
22 | pub const PROVIDER_CHECK_INTERVAL: u64 = 30;
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: constant `CHUNK_SIZE` is never used
--> src/audio/constants.rs:25:11
|
25 | pub const CHUNK_SIZE: usize = SAMPLE_RATE as usize * (CHUNK_DURATION_MS as usize / 1000);
| ^^^^^^^^^^
warning: variants `InitializationError`, `DisconnectionError`, and `BufferError` are never constructed
--> src/audio/stream_manager.rs:18:5
|
16 | pub enum AudioStreamError {
| ---------------- variants in this enum
17 | #[error("Failed to initialize stream: {0}")]
18 | InitializationError(String),
| ^^^^^^^^^^^^^^^^^^^
...
21 | DisconnectionError(String),
| ^^^^^^^^^^^^^^^^^^
...
24 | BufferError(String),
| ^^^^^^^^^^^
|
= note: `AudioStreamError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: fields `buffer`, `recording_state`, and `provider` are never read
--> src/audio/stream_manager.rs:30:5
|
28 | pub struct AudioStreamManager {
| ------------------ fields in this struct
29 | stream: Option<AudioStream>,
30 | buffer: Arc<StdMutex<AudioBuffer>>,
| ^^^^^^
31 | recording_state: RecordingState,
| ^^^^^^^^^^^^^^^
32 | device: Arc<AudioDevice>,
33 | provider: Arc<TokioMutex<Box<dyn TranscriptionProvider + Send + Sync>>>,
| ^^^^^^^^
warning: methods `handle_stream_error`, `is_active`, `is_disconnected`, `get_buffer`, and `get_recording_state` are never used
--> src/audio/stream_manager.rs:95:12
|
37 | impl AudioStreamManager {
| ----------------------- methods in this implementation
...
95 | pub fn handle_stream_error(&self, error: AudioStreamError) {
| ^^^^^^^^^^^^^^^^^^^
...
102 | pub fn is_active(&self) -> bool {
| ^^^^^^^^^
...
107 | pub fn is_disconnected(&self) -> bool {
| ^^^^^^^^^^^^^^^
...
112 | pub fn get_buffer(&self) -> Arc<StdMutex<AudioBuffer>> {
| ^^^^^^^^^^
...
117 | pub fn get_recording_state(&self) -> RecordingState {
| ^^^^^^^^^^^^^^^^^^^
warning: field `active` is never read
--> src/audio_state.rs:8:9
|
7 | pub struct RecordingState {
| -------------- field in this struct
8 | pub active: Arc<AtomicBool>,
| ^^^^^^
|
= note: `RecordingState` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: methods `set_active`, `is_active`, and `toggle` are never used
--> src/audio_state.rs:18:12
|
11 | impl RecordingState {
| ------------------- methods in this implementation
...
18 | pub fn set_active(&self, active: bool) {
| ^^^^^^^^^^
...
22 | pub fn is_active(&self) -> bool {
| ^^^^^^^^^
...
26 | pub fn toggle(&self) -> bool {
| ^^^^^^
warning: struct `HotkeyService` is never constructed
--> src/hotkey_service.rs:15:12
|
15 | pub struct HotkeyService {
| ^^^^^^^^^^^^^
warning: associated items `new`, `register_hotkey`, and `run` are never used
--> src/hotkey_service.rs:21:12
|
20 | impl HotkeyService {
| ------------------ associated items in this implementation
21 | pub fn new(recording_state: RecordingState) -> Result<Self> {
| ^^^
...
29 | pub fn register_hotkey(&self, hotkey_str: &str) -> Result<()> {
| ^^^^^^^^^^^^^^^
...
35 | pub async fn run(&self) {
| ^^^
warning: function `is_debug_mode` is never used
--> src/my_tracing.rs:106:8
|
106 | pub fn is_debug_mode() -> bool {
| ^^^^^^^^^^^^^
warning: methods `name` and `min_chunk_duration` are never used
--> src/providers/mod.rs:14:8
|
13 | pub trait TranscriptionProvider {
| --------------------- methods in this trait
14 | fn name(&self) -> &'static str;
| ^^^^
...
17 | fn min_chunk_duration(&self) -> std::time::Duration {
| ^^^^^^^^^^^^^^^^^^
warning: associated function `new` is never used
--> src/providers/mod.rs:27:12
|
26 | impl MockProvider {
| ----------------- associated function in this implementation
27 | pub fn new() -> Self {
| ^^^
warning: function `create_provider` is never used
--> src/providers/mod.rs:56:8
|
56 | pub fn create_provider(provider_name: &str) -> Box<dyn TranscriptionProvider + Send + Sync> {
| ^^^^^^^^^^^^^^^
warning: variants `First` and `Last` are never constructed
--> src/shutdown_handler.rs:19:5
|
17 | pub enum ExitPriority {
| ------------ variants in this enum
18 | /// First actions to perform during shutdown
19 | First = 0,
| ^^^^^
...
23 | Last = 100,
| ^^^^
|
= note: `ExitPriority` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: variants `Completed`, `TimedOut`, `Forced`, and `Failed` are never constructed
--> src/shutdown_handler.rs:30:5
|
28 | pub enum ShutdownActionStatus {
| -------------------- variants in this enum
29 | /// Action completed successfully
30 | Completed,
| ^^^^^^^^^
31 | /// Action timed out
32 | TimedOut,
| ^^^^^^^^
33 | /// Action was forced to terminate
34 | Forced,
| ^^^^^^
35 | /// Action failed with an error
36 | Failed,
| ^^^^^^
|
= note: `ShutdownActionStatus` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: fields `name`, `action`, and `priority` are never read
--> src/shutdown_handler.rs:42:5
|
40 | struct ExitHandler {
| ----------- fields in this struct
41 | /// Human-readable name for the action
42 | name: String,
| ^^^^
43 | /// The function to call during shutdown
44 | action: ShutdownAction,
| ^^^^^^
45 | /// Priority that determines execution order
46 | priority: ExitPriority,
| ^^^^^^^^
warning: struct `ShutdownResult` is never constructed
--> src/shutdown_handler.rs:51:12
|
51 | pub struct ShutdownResult {
| ^^^^^^^^^^^^^^
|
= note: `ShutdownResult` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: fields `timeout_duration` and `force_shutdown_tx` are never read
--> src/shutdown_handler.rs:69:5
|
67 | pub struct ShutdownManager {
| --------------- fields in this struct
68 | handlers: Arc<Mutex<Vec<ExitHandler>>>,
69 | timeout_duration: Duration,
| ^^^^^^^^^^^^^^^^
70 | force_shutdown_tx: broadcast::Sender<()>,
| ^^^^^^^^^^^^^^^^^
warning: methods `with_timeout`, `execute_action`, `execute_shutdown`, and `force_shutdown` are never used
--> src/shutdown_handler.rs:93:12
|
80 | impl ShutdownManager {
| -------------------- methods in this implementation
...
93 | pub fn with_timeout(mut self, duration: Duration) -> Self {
| ^^^^^^^^^^^^
...
123 | async fn execute_action(
| ^^^^^^^^^^^^^^
...
167 | pub async fn execute_shutdown(&self) -> ShutdownResult {
| ^^^^^^^^^^^^^^^^
...
216 | pub async fn force_shutdown(&self) -> ShutdownResult {
| ^^^^^^^^^^^^^^
warning: struct `ChunkingManager` is never constructed
--> src/transcription/mod.rs:18:12
|
18 | pub struct ChunkingManager {
| ^^^^^^^^^^^^^^^
warning: associated items `new`, `add_samples`, `take_remaining`, `buffered_samples`, `required_samples`, and `current_duration` are never used
--> src/transcription/mod.rs:27:12
|
25 | impl ChunkingManager {
| -------------------- associated items in this implementation
26 | /// Create a new ChunkingManager with the specified sample rate and minimum chunk duration
27 | pub fn new(sample_rate: u32, min_chunk_duration: Duration) -> Self {
| ^^^
...
38 | pub fn add_samples(&mut self, samples: &[f32]) -> Vec<Vec<f32>> {
| ^^^^^^^^^^^
...
50 | pub fn take_remaining(&mut self) -> Vec<f32> {
| ^^^^^^^^^^^^^^
...
55 | pub fn buffered_samples(&self) -> usize {
| ^^^^^^^^^^^^^^^^
...
60 | pub fn required_samples(&self) -> usize {
| ^^^^^^^^^^^^^^^^
...
65 | pub fn current_duration(&self) -> f32 {
| ^^^^^^^^^^^^^^^^
warning: call to `.clone()` on a reference in this situation does nothing
--> src/audio/stream_manager.rs:126:48
|
126 | let shutdown_manager = shutdown_manager.clone();
| ^^^^^^^^
|
= note: the type `ShutdownManager` does not implement `Clone`, so calling `clone` on `&ShutdownManager` copies the reference, which does not do anything and can be removed
= note: `#[warn(noop_method_call)]` on by default
help: remove this redundant call
|
126 - let shutdown_manager = shutdown_manager.clone();
126 + let shutdown_manager = shutdown_manager;
|
help: if you meant to clone `ShutdownManager`, implement `Clone` for it
--> src/shutdown_handler.rs:67:1
|
67 + #[derive(Clone)]
68 | pub struct ShutdownManager {
|
warning: `groq-api-rs` (bin "groq-api-rs") generated 57 warnings (run `cargo fix --bin "groq-api-rs"` to apply 12 suggestions)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s