🔧 fix unused variable warning and suppress must-use lint in macros
- Prefix `_object_id` parameter with underscore to silence unused variable warning in `get_item` - Add #[allow(unused_must_use)] to all action macro definitions in pmoupnp/macros.rs - Remove redundant doc comment line break
This commit is contained in:
@@ -443,7 +443,7 @@ pub trait MusicSource: Debug + Send + Sync {
|
||||
/// let item = source.get_item("track-123").await?;
|
||||
/// println!("Now playing: {} by {}", item.title, item.artist.unwrap_or_default());
|
||||
/// ```
|
||||
async fn get_item(&self, object_id: &str) -> Result<Item> {
|
||||
async fn get_item(&self, _object_id: &str) -> Result<Item> {
|
||||
// Default implementation: try to find it in parent's browse result
|
||||
// This is inefficient and should be overridden by implementations
|
||||
Err(MusicSourceError::NotSupported(
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
/// ```
|
||||
///
|
||||
/// # Notes d'implémentation
|
||||
///
|
||||
/// - Les `Arc<StateVariable>` sont clonés (shallow copy du pointeur)
|
||||
/// - Chaque `Argument` est wrappé dans un `Arc`
|
||||
/// - L'`Action` finale est wrappée dans un `Arc`
|
||||
@@ -112,6 +111,7 @@ macro_rules! define_action {
|
||||
}
|
||||
$(with handler $handler:expr)?
|
||||
) => {
|
||||
#[allow(unused_must_use)]
|
||||
pub static $name: once_cell::sync::Lazy<std::sync::Arc<$crate::actions::Action>> =
|
||||
once_cell::sync::Lazy::new(|| {
|
||||
let mut ac = $crate::actions::Action::new($action_name.to_string());
|
||||
@@ -135,6 +135,7 @@ macro_rules! define_action {
|
||||
(pub static $name:ident = $action_name:literal stateless
|
||||
$(with handler $handler:expr)?
|
||||
) => {
|
||||
#[allow(unused_must_use)]
|
||||
pub static $name: once_cell::sync::Lazy<std::sync::Arc<$crate::actions::Action>> =
|
||||
once_cell::sync::Lazy::new(|| {
|
||||
let mut ac = $crate::actions::Action::new($action_name.to_string());
|
||||
@@ -156,6 +157,7 @@ macro_rules! define_action {
|
||||
}
|
||||
$(with handler $handler:expr)?
|
||||
) => {
|
||||
#[allow(unused_must_use)]
|
||||
pub static $name: once_cell::sync::Lazy<std::sync::Arc<$crate::actions::Action>> =
|
||||
once_cell::sync::Lazy::new(|| {
|
||||
let mut ac = $crate::actions::Action::new($action_name.to_string());
|
||||
@@ -178,6 +180,7 @@ macro_rules! define_action {
|
||||
(pub static $name:ident = $action_name:literal
|
||||
$(with handler $handler:expr)?
|
||||
) => {
|
||||
#[allow(unused_must_use)]
|
||||
pub static $name: once_cell::sync::Lazy<std::sync::Arc<$crate::actions::Action>> =
|
||||
once_cell::sync::Lazy::new(|| {
|
||||
let mut ac = $crate::actions::Action::new($action_name.to_string());
|
||||
|
||||
Reference in New Issue
Block a user