diff --git a/Makefile b/Makefile index abfb1e3..978005e 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ fmt: cargo fmt --all lint: cargo +nightly clippy --all --all-targets --all-features --fix -Z unstable-options --allow-dirty --allow-staged +hack: + cargo hack check --each-feature --no-dev-deps --all test: cargo test --all-features watch: diff --git a/src/handler/mod.rs b/src/handler/mod.rs index 5c1246a..bd4c836 100644 --- a/src/handler/mod.rs +++ b/src/handler/mod.rs @@ -107,7 +107,6 @@ impl EventHandler for Handler { new_voice_state: voice::VoiceState, ) { let state = CurrentVoiceState::new(new_voice_state); - #[cfg(feature = "tts")] let change = state.change_of_states(old_voice_state.as_ref()); let member = state.voice_member().await.expect("member is not received"); let voice = Voice::from(&ctx, member.guild_id).await; diff --git a/src/handler/usecase/text_to_speech/text_to_speech_base.rs b/src/handler/usecase/text_to_speech/text_to_speech_base.rs index a5f0157..66d7c25 100644 --- a/src/handler/usecase/text_to_speech/text_to_speech_base.rs +++ b/src/handler/usecase/text_to_speech/text_to_speech_base.rs @@ -1,7 +1,10 @@ +#[cfg(feature = "tts")] use super::super::interface::Speaker; +#[cfg(feature = "tts")] use super::config; #[cfg(feature = "tts")] use super::text_to_speech_message::Message; +#[cfg(feature = "tts")] use crate::infrastructure::GuildPath; #[derive(Debug, PartialEq, Eq)] diff --git a/src/model/message.rs b/src/model/message.rs index eed4ed9..05813af 100644 --- a/src/model/message.rs +++ b/src/model/message.rs @@ -1,6 +1,9 @@ +#[cfg(feature = "tts")] use serenity::model::channel::Message as SerenityMessage; +#[cfg(feature = "tts")] use std::env; +#[cfg(feature = "tts")] pub struct Message { pub msg: SerenityMessage, }