From 465f21da46a7194e25894043ca2cca9ba958e11c Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Sun, 13 Jun 2021 20:48:54 +0200 Subject: add unreachable_pub lint and fix debug impl --- mumd/src/audio/input.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mumd/src/audio/input.rs') diff --git a/mumd/src/audio/input.rs b/mumd/src/audio/input.rs index a1227e3..2a904d9 100644 --- a/mumd/src/audio/input.rs +++ b/mumd/src/audio/input.rs @@ -1,6 +1,7 @@ use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use cpal::{InputCallbackInfo, Sample, SampleFormat, SampleRate, StreamConfig}; use log::*; +use std::fmt::Debug; use tokio::sync::watch; use crate::audio::SAMPLE_RATE; @@ -177,3 +178,14 @@ impl AudioInputDevice for DefaultAudioInputDevice { self.channels as usize } } + +impl Debug for DefaultAudioInputDevice { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("DefaultAudioInputDevice") + .field("sample_receiver", &self.sample_receiver) + .field("channels", &self.channels) + .field("volume_sender", &self.volume_sender) + .field("stream", &"cpal::Stream") + .finish() + } +} -- cgit v1.2.1