rustpotter detections optimization + few code improvements

This commit is contained in:
Priler 2026-01-04 06:14:05 +05:00
parent 88d73eeb10
commit 61b7a79455
12 changed files with 64 additions and 58 deletions

View file

@ -11,7 +11,7 @@ use crate::{config, DB, SOUND_DIR};
static AUDIO_TYPE: OnceCell<AudioType> = OnceCell::new();
pub fn init() -> Result<(), ()> {
if !AUDIO_TYPE.get().is_none() {
if AUDIO_TYPE.get().is_some() {
return Ok(());
} // already initialized
@ -29,7 +29,7 @@ pub fn init() -> Result<(), ()> {
Ok(_) => {
info!("Successfully initialized Rodio audio backend.");
}
Err(msg) => {
Err(()) => {
error!("Failed to initialize Rodio audio backend.");
return Err(());