Apply clippy lint

Signed-off-by: x1a0b0 <xbtseng@gmail.com>
This commit is contained in:
x1a0b0
2025-10-13 11:34:44 +08:00
parent d43a9588c9
commit 61943b16ac
6 changed files with 8 additions and 14 deletions
+3 -6
View File
@@ -147,12 +147,9 @@ async fn on_event(event: Event) -> Result<(), AppError> {
async fn on_stream(stream: Stream) -> Result<(), AppError> {
let Stream { tag, bytes, .. } = stream;
match tag.as_str() {
"play" => {
// 播放接收到的音频流
let _ = AudioPlayer::instance().play(bytes).await;
}
_ => {}
if tag.as_str() == "play" {
// 播放接收到的音频流
let _ = AudioPlayer::instance().play(bytes).await;
}
Ok(())
}
+1 -1
View File
@@ -29,7 +29,7 @@ async fn on_keyword(_keyword: String) {
.split("\n")
.filter(|line| !line.trim().is_empty())
.collect::<Vec<&str>>();
if replies.len() > 0 {
if !replies.is_empty() {
wakeup_sounds.clear();
wakeup_sounds.extend(replies.iter().map(|s| s.to_string()));
}