From 010d233920774205db814aeb194699c9e4614b84 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 09:21:27 +0000 Subject: [PATCH] fix: Add #[async_trait] to RadioParadiseExt to eliminate warning Add async_trait annotation to RadioParadiseExt trait and its implementation to suppress the "async fn in public traits" warning. This is the recommended approach for traits with async methods as it ensures proper Future bounds (Send) are generated. --- pmoparadise/src/pmoserver_ext.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmoparadise/src/pmoserver_ext.rs b/pmoparadise/src/pmoserver_ext.rs index e245f21d..5c19d5ad 100644 --- a/pmoparadise/src/pmoserver_ext.rs +++ b/pmoparadise/src/pmoserver_ext.rs @@ -5,6 +5,7 @@ use crate::channels::{max_channel_id, ChannelDescriptor, ALL_CHANNELS}; use crate::{Block, NowPlaying, RadioParadiseClient}; +use async_trait::async_trait; use axum::{ extract::{Path, Query, State}, http::StatusCode, @@ -352,6 +353,7 @@ pub fn create_api_router(state: RadioParadiseState) -> Router { /// /// Permet d'initialiser Radio Paradise avec routes HTTP complètes #[cfg(feature = "pmoserver")] +#[async_trait] pub trait RadioParadiseExt { /// Initialise l'API Radio Paradise /// @@ -366,6 +368,7 @@ pub trait RadioParadiseExt { } #[cfg(feature = "pmoserver")] +#[async_trait] impl RadioParadiseExt for pmoserver::Server { async fn init_radioparadise(&mut self) -> anyhow::Result { let state = RadioParadiseState::new().await?;