From 7ec268094d2b665401934f805b8a073a3eaff242 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 8 Dec 2025 17:48:44 +0900 Subject: [PATCH] commands: store `SubtypeParserError` expected type as `&str` --- src/commands.rs | 6 +++--- src/commands/audio_output_devices/outputset.rs | 2 +- src/commands/client_to_client/sendmessage.rs | 2 +- src/commands/connection_settings/protocol_disable.rs | 2 +- src/commands/connection_settings/protocol_enable.rs | 2 +- src/commands/connection_settings/tag_types_disable.rs | 2 +- src/commands/connection_settings/tag_types_enable.rs | 2 +- src/commands/connection_settings/tag_types_reset.rs | 2 +- src/commands/controlling_playback/pause.rs | 2 +- src/commands/controlling_playback/seek.rs | 4 ++-- src/commands/controlling_playback/seekcur.rs | 6 +++--- src/commands/controlling_playback/seekid.rs | 4 ++-- src/commands/mounts_and_neighbors/mount.rs | 2 +- src/commands/mounts_and_neighbors/unmount.rs | 2 +- src/commands/music_database/albumart.rs | 2 +- src/commands/music_database/count.rs | 2 +- src/commands/music_database/find.rs | 4 ++-- src/commands/music_database/findadd.rs | 6 +++--- src/commands/music_database/list.rs | 6 +++--- src/commands/music_database/readpicture.rs | 2 +- src/commands/music_database/search.rs | 4 ++-- src/commands/music_database/searchadd.rs | 6 +++--- src/commands/music_database/searchaddpl.rs | 6 +++--- src/commands/music_database/searchcount.rs | 2 +- src/commands/playback_options/random.rs | 2 +- src/commands/playback_options/repeat.rs | 2 +- src/commands/queue/add.rs | 2 +- src/commands/queue/addid.rs | 2 +- src/commands/queue/addtagid.rs | 6 +++--- src/commands/queue/cleartagid.rs | 4 ++-- src/commands/queue/move_.rs | 4 ++-- src/commands/queue/moveid.rs | 4 ++-- src/commands/queue/playlistfind.rs | 4 ++-- src/commands/queue/playlistsearch.rs | 4 ++-- src/commands/queue/plchanges.rs | 4 ++-- src/commands/queue/plchangesposid.rs | 4 ++-- src/commands/queue/prio.rs | 4 ++-- src/commands/queue/prioid.rs | 2 +- src/commands/queue/rangeid.rs | 4 ++-- src/commands/queue/swap.rs | 4 ++-- src/commands/queue/swapid.rs | 4 ++-- src/commands/stickers/sticker_dec.rs | 8 ++++---- src/commands/stickers/sticker_delete.rs | 6 +++--- src/commands/stickers/sticker_find.rs | 10 +++++----- src/commands/stickers/sticker_get.rs | 6 +++--- src/commands/stickers/sticker_inc.rs | 8 ++++---- src/commands/stickers/sticker_list.rs | 4 ++-- src/commands/stickers/sticker_set.rs | 6 +++--- src/commands/stored_playlists/playlistadd.rs | 2 +- src/commands/stored_playlists/searchplaylist.rs | 4 ++-- 50 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 36a9c93..9c31459 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -374,7 +374,7 @@ macro_rules! single_item_command_request { let item = item_token.parse::<$item_type>().map_err(|_| { crate::commands::RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: stringify!($item_type).to_string(), + expected_type: stringify!($item_type), raw_input: item_token.to_owned(), } })?; @@ -431,7 +431,7 @@ macro_rules! single_optional_item_command_request { s.parse().map_err(|_| { crate::commands::RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: stringify!($item_type).to_string(), + expected_type: stringify!($item_type), raw_input: s.to_owned(), } }) @@ -566,7 +566,7 @@ pub enum RequestParserError { argument_index: u32, /// The expected type of the argument - expected_type: String, + expected_type: &'static str, /// The raw input that failed to parse raw_input: String, diff --git a/src/commands/audio_output_devices/outputset.rs b/src/commands/audio_output_devices/outputset.rs index c82a6e9..7b7e850 100644 --- a/src/commands/audio_output_devices/outputset.rs +++ b/src/commands/audio_output_devices/outputset.rs @@ -53,7 +53,7 @@ impl CommandRequest for OutputSetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "AudioOutputId".to_string(), + expected_type: "AudioOutputId", raw_input: output_id.to_string(), })?; let attribute_name = parts.next().ok_or(Self::missing_arguments_error(1))?; diff --git a/src/commands/client_to_client/sendmessage.rs b/src/commands/client_to_client/sendmessage.rs index f5e1519..27af7a0 100644 --- a/src/commands/client_to_client/sendmessage.rs +++ b/src/commands/client_to_client/sendmessage.rs @@ -42,7 +42,7 @@ impl CommandRequest for SendMessageRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "ChannelName".to_string(), + expected_type: "ChannelName", raw_input: channel.to_string(), })?; diff --git a/src/commands/connection_settings/protocol_disable.rs b/src/commands/connection_settings/protocol_disable.rs index 386e524..a494e53 100644 --- a/src/commands/connection_settings/protocol_disable.rs +++ b/src/commands/connection_settings/protocol_disable.rs @@ -46,7 +46,7 @@ impl CommandRequest for ProtocolDisableRequest { f.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: i.try_into().unwrap_or(u32::MAX), - expected_type: "Feature".to_owned(), + expected_type: "Feature", raw_input: f.to_owned(), }) }) diff --git a/src/commands/connection_settings/protocol_enable.rs b/src/commands/connection_settings/protocol_enable.rs index 23e595d..a17ef58 100644 --- a/src/commands/connection_settings/protocol_enable.rs +++ b/src/commands/connection_settings/protocol_enable.rs @@ -46,7 +46,7 @@ impl CommandRequest for ProtocolEnableRequest { f.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: i.try_into().unwrap_or(u32::MAX), - expected_type: "Feature".to_owned(), + expected_type: "Feature", raw_input: f.to_owned(), }) }) diff --git a/src/commands/connection_settings/tag_types_disable.rs b/src/commands/connection_settings/tag_types_disable.rs index 05bfdbb..6575910 100644 --- a/src/commands/connection_settings/tag_types_disable.rs +++ b/src/commands/connection_settings/tag_types_disable.rs @@ -50,7 +50,7 @@ impl CommandRequest for TagTypesDisableRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: i.try_into().unwrap_or(u32::MAX), - expected_type: "TagName".to_owned(), + expected_type: "TagName", raw_input: s.to_owned(), }) }) diff --git a/src/commands/connection_settings/tag_types_enable.rs b/src/commands/connection_settings/tag_types_enable.rs index bfe14d1..382b29c 100644 --- a/src/commands/connection_settings/tag_types_enable.rs +++ b/src/commands/connection_settings/tag_types_enable.rs @@ -48,7 +48,7 @@ impl CommandRequest for TagTypesEnableRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: i.try_into().unwrap_or(u32::MAX), - expected_type: "TagName".to_owned(), + expected_type: "TagName", raw_input: s.to_owned(), }) }) diff --git a/src/commands/connection_settings/tag_types_reset.rs b/src/commands/connection_settings/tag_types_reset.rs index d745bc9..39abca8 100644 --- a/src/commands/connection_settings/tag_types_reset.rs +++ b/src/commands/connection_settings/tag_types_reset.rs @@ -48,7 +48,7 @@ impl CommandRequest for TagTypesResetRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: i.try_into().unwrap_or(u32::MAX), - expected_type: "TagName".to_owned(), + expected_type: "TagName", raw_input: s.to_owned(), }) }) diff --git a/src/commands/controlling_playback/pause.rs b/src/commands/controlling_playback/pause.rs index 43d741d..1025aa3 100644 --- a/src/commands/controlling_playback/pause.rs +++ b/src/commands/controlling_playback/pause.rs @@ -37,7 +37,7 @@ impl CommandRequest for PauseRequest { Some("1") => Ok(Some(true)), Some(s) => Err(RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "Option".to_owned(), + expected_type: "Option", raw_input: s.to_owned(), }), None => Ok(None), diff --git a/src/commands/controlling_playback/seek.rs b/src/commands/controlling_playback/seek.rs index 0213ef3..f4cc2f5 100644 --- a/src/commands/controlling_playback/seek.rs +++ b/src/commands/controlling_playback/seek.rs @@ -40,7 +40,7 @@ impl CommandRequest for SeekRequest { s.parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: s.to_owned(), })? } @@ -52,7 +52,7 @@ impl CommandRequest for SeekRequest { Some(t) => t.parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "TimeWithFractions".to_string(), + expected_type: "TimeWithFractions", raw_input: t.to_owned(), } })?, diff --git a/src/commands/controlling_playback/seekcur.rs b/src/commands/controlling_playback/seekcur.rs index d6ab320..4b166e8 100644 --- a/src/commands/controlling_playback/seekcur.rs +++ b/src/commands/controlling_playback/seekcur.rs @@ -55,7 +55,7 @@ impl CommandRequest for SeekCurRequest { t[1..].parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "TimeWithFractions".to_string(), + expected_type: "TimeWithFractions", raw_input: t[1..].to_owned(), } })?, @@ -65,7 +65,7 @@ impl CommandRequest for SeekCurRequest { t[1..].parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "TimeWithFractions".to_string(), + expected_type: "TimeWithFractions", raw_input: t[1..].to_owned(), } })?, @@ -75,7 +75,7 @@ impl CommandRequest for SeekCurRequest { t.parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "TimeWithFractions".to_string(), + expected_type: "TimeWithFractions", raw_input: t.to_owned(), } })?, diff --git a/src/commands/controlling_playback/seekid.rs b/src/commands/controlling_playback/seekid.rs index 3f9eeb9..ea87cb4 100644 --- a/src/commands/controlling_playback/seekid.rs +++ b/src/commands/controlling_playback/seekid.rs @@ -40,7 +40,7 @@ impl CommandRequest for SeekIdRequest { .parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: s.to_owned(), })?, None => return Err(Self::missing_arguments_error(0)), @@ -50,7 +50,7 @@ impl CommandRequest for SeekIdRequest { Some(t) => t.parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "TimeWithFractions".to_string(), + expected_type: "TimeWithFractions", raw_input: t.to_owned(), } })?, diff --git a/src/commands/mounts_and_neighbors/mount.rs b/src/commands/mounts_and_neighbors/mount.rs index da5fe50..5300f12 100644 --- a/src/commands/mounts_and_neighbors/mount.rs +++ b/src/commands/mounts_and_neighbors/mount.rs @@ -46,7 +46,7 @@ impl CommandRequest for MountRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "MountPath".to_string(), + expected_type: "MountPath", raw_input: path.to_string(), })?; diff --git a/src/commands/mounts_and_neighbors/unmount.rs b/src/commands/mounts_and_neighbors/unmount.rs index c307cc4..e442c1d 100644 --- a/src/commands/mounts_and_neighbors/unmount.rs +++ b/src/commands/mounts_and_neighbors/unmount.rs @@ -41,7 +41,7 @@ impl CommandRequest for UnmountRequest { path.parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "MountPath".to_string(), + expected_type: "MountPath", raw_input: path.to_string(), })?; diff --git a/src/commands/music_database/albumart.rs b/src/commands/music_database/albumart.rs index a40e218..fcb59b7 100644 --- a/src/commands/music_database/albumart.rs +++ b/src/commands/music_database/albumart.rs @@ -48,7 +48,7 @@ impl CommandRequest for AlbumArtRequest { .parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Offset".to_string(), + expected_type: "Offset", raw_input: s.to_string(), })?, None => return Err(Self::missing_arguments_error(1)), diff --git a/src/commands/music_database/count.rs b/src/commands/music_database/count.rs index da9fa92..0496cf3 100644 --- a/src/commands/music_database/count.rs +++ b/src/commands/music_database/count.rs @@ -64,7 +64,7 @@ impl CommandRequest for CountRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "GroupType".to_string(), + expected_type: "GroupType", raw_input: group.to_owned(), })?, ) diff --git a/src/commands/music_database/find.rs b/src/commands/music_database/find.rs index 6ea0290..cc904e1 100644 --- a/src/commands/music_database/find.rs +++ b/src/commands/music_database/find.rs @@ -72,7 +72,7 @@ impl CommandRequest for FindRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -92,7 +92,7 @@ impl CommandRequest for FindRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); diff --git a/src/commands/music_database/findadd.rs b/src/commands/music_database/findadd.rs index 86f6f2c..6c1a0e1 100644 --- a/src/commands/music_database/findadd.rs +++ b/src/commands/music_database/findadd.rs @@ -76,7 +76,7 @@ impl CommandRequest for FindAddRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -96,7 +96,7 @@ impl CommandRequest for FindAddRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); @@ -116,7 +116,7 @@ impl CommandRequest for FindAddRequest { p.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: p.to_string(), })?, ); diff --git a/src/commands/music_database/list.rs b/src/commands/music_database/list.rs index 6e61af8..1b99fad 100644 --- a/src/commands/music_database/list.rs +++ b/src/commands/music_database/list.rs @@ -60,7 +60,7 @@ impl CommandRequest for ListRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "TagName".to_string(), + expected_type: "TagName", raw_input: tagname.to_owned(), })?; @@ -97,7 +97,7 @@ impl CommandRequest for ListRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "GroupType".to_string(), + expected_type: "GroupType", raw_input: group.to_owned(), })?; groups.push(parsed_group); @@ -118,7 +118,7 @@ impl CommandRequest for ListRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 3, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: window_str.to_owned(), })?; window = Some(parsed_window); diff --git a/src/commands/music_database/readpicture.rs b/src/commands/music_database/readpicture.rs index 30a15ce..8573921 100644 --- a/src/commands/music_database/readpicture.rs +++ b/src/commands/music_database/readpicture.rs @@ -50,7 +50,7 @@ impl CommandRequest for ReadPictureRequest { .parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Offset".to_string(), + expected_type: "Offset", raw_input: s.to_owned(), })?, None => return Err(Self::missing_arguments_error(1)), diff --git a/src/commands/music_database/search.rs b/src/commands/music_database/search.rs index 5882a07..5f7f131 100644 --- a/src/commands/music_database/search.rs +++ b/src/commands/music_database/search.rs @@ -72,7 +72,7 @@ impl CommandRequest for SearchRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -92,7 +92,7 @@ impl CommandRequest for SearchRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); diff --git a/src/commands/music_database/searchadd.rs b/src/commands/music_database/searchadd.rs index 336c3ec..1855bd5 100644 --- a/src/commands/music_database/searchadd.rs +++ b/src/commands/music_database/searchadd.rs @@ -76,7 +76,7 @@ impl CommandRequest for SearchAddRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -96,7 +96,7 @@ impl CommandRequest for SearchAddRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); @@ -116,7 +116,7 @@ impl CommandRequest for SearchAddRequest { p.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: p.to_string(), })?, ); diff --git a/src/commands/music_database/searchaddpl.rs b/src/commands/music_database/searchaddpl.rs index 8104db8..619128b 100644 --- a/src/commands/music_database/searchaddpl.rs +++ b/src/commands/music_database/searchaddpl.rs @@ -91,7 +91,7 @@ impl CommandRequest for SearchAddPlRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -111,7 +111,7 @@ impl CommandRequest for SearchAddPlRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); @@ -131,7 +131,7 @@ impl CommandRequest for SearchAddPlRequest { p.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: p.to_string(), })?, ); diff --git a/src/commands/music_database/searchcount.rs b/src/commands/music_database/searchcount.rs index d0bce41..3513638 100644 --- a/src/commands/music_database/searchcount.rs +++ b/src/commands/music_database/searchcount.rs @@ -65,7 +65,7 @@ impl CommandRequest for SearchCountRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Group".to_string(), + expected_type: "Group", raw_input: group.to_string(), })?, ) diff --git a/src/commands/playback_options/random.rs b/src/commands/playback_options/random.rs index 9422d59..ae8cd8a 100644 --- a/src/commands/playback_options/random.rs +++ b/src/commands/playback_options/random.rs @@ -35,7 +35,7 @@ impl CommandRequest for RandomRequest { Some(s) => { return Err(RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "bool".to_owned(), + expected_type: "bool", raw_input: s.to_owned(), }); } diff --git a/src/commands/playback_options/repeat.rs b/src/commands/playback_options/repeat.rs index 05ea197..9f64ea1 100644 --- a/src/commands/playback_options/repeat.rs +++ b/src/commands/playback_options/repeat.rs @@ -35,7 +35,7 @@ impl CommandRequest for RepeatRequest { Some(s) => { return Err(RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "bool".to_owned(), + expected_type: "bool", raw_input: s.to_owned(), }); } diff --git a/src/commands/queue/add.rs b/src/commands/queue/add.rs index 594e4a9..930bb51 100644 --- a/src/commands/queue/add.rs +++ b/src/commands/queue/add.rs @@ -47,7 +47,7 @@ impl CommandRequest for AddRequest { Some(s) => Some(s.parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: s.to_owned(), } })?), diff --git a/src/commands/queue/addid.rs b/src/commands/queue/addid.rs index 9c0c1da..d89ef5b 100644 --- a/src/commands/queue/addid.rs +++ b/src/commands/queue/addid.rs @@ -48,7 +48,7 @@ impl CommandRequest for AddIdRequest { Some(s) => Some(s.parse::().map_err(|_| { RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: s.to_owned(), } })?), diff --git a/src/commands/queue/addtagid.rs b/src/commands/queue/addtagid.rs index 79abc4f..ae13171 100644 --- a/src/commands/queue/addtagid.rs +++ b/src/commands/queue/addtagid.rs @@ -51,7 +51,7 @@ impl CommandRequest for AddTagIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: songid.to_owned(), })?; @@ -60,7 +60,7 @@ impl CommandRequest for AddTagIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "TagName".to_string(), + expected_type: "TagName", raw_input: tag_name.to_owned(), })?; @@ -69,7 +69,7 @@ impl CommandRequest for AddTagIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "TagValue".to_string(), + expected_type: "TagValue", raw_input: tag_value.to_owned(), })?; diff --git a/src/commands/queue/cleartagid.rs b/src/commands/queue/cleartagid.rs index 1cf9c6b..081c120 100644 --- a/src/commands/queue/cleartagid.rs +++ b/src/commands/queue/cleartagid.rs @@ -42,7 +42,7 @@ impl CommandRequest for ClearTagIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: songid.to_string(), })?; @@ -51,7 +51,7 @@ impl CommandRequest for ClearTagIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "TagName".to_string(), + expected_type: "TagName", raw_input: tag_name.to_string(), })?; diff --git a/src/commands/queue/move_.rs b/src/commands/queue/move_.rs index e6ffc36..ab75c88 100644 --- a/src/commands/queue/move_.rs +++ b/src/commands/queue/move_.rs @@ -41,7 +41,7 @@ impl CommandRequest for MoveRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "OneOrRange".to_string(), + expected_type: "OneOrRange", raw_input: from_or_range.to_string(), })?; @@ -50,7 +50,7 @@ impl CommandRequest for MoveRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "AbsoluteRelativeSongPosition".to_string(), + expected_type: "AbsoluteRelativeSongPosition", raw_input: to.to_string(), })?; diff --git a/src/commands/queue/moveid.rs b/src/commands/queue/moveid.rs index 9dc4dc8..742d957 100644 --- a/src/commands/queue/moveid.rs +++ b/src/commands/queue/moveid.rs @@ -40,7 +40,7 @@ impl CommandRequest for MoveIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: id.to_string(), })?; @@ -49,7 +49,7 @@ impl CommandRequest for MoveIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "AbsoluteRelativeSongPosition".to_string(), + expected_type: "AbsoluteRelativeSongPosition", raw_input: to.to_string(), })?; diff --git a/src/commands/queue/playlistfind.rs b/src/commands/queue/playlistfind.rs index b05e716..b93b06e 100644 --- a/src/commands/queue/playlistfind.rs +++ b/src/commands/queue/playlistfind.rs @@ -73,7 +73,7 @@ impl CommandRequest for PlaylistFindRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -93,7 +93,7 @@ impl CommandRequest for PlaylistFindRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); diff --git a/src/commands/queue/playlistsearch.rs b/src/commands/queue/playlistsearch.rs index 93f25e2..825fc12 100644 --- a/src/commands/queue/playlistsearch.rs +++ b/src/commands/queue/playlistsearch.rs @@ -72,7 +72,7 @@ impl CommandRequest for PlaylistSearchRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -92,7 +92,7 @@ impl CommandRequest for PlaylistSearchRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); diff --git a/src/commands/queue/plchanges.rs b/src/commands/queue/plchanges.rs index aae816b..83774af 100644 --- a/src/commands/queue/plchanges.rs +++ b/src/commands/queue/plchanges.rs @@ -46,7 +46,7 @@ impl CommandRequest for PlChangesRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "PlaylistVersion".to_string(), + expected_type: "PlaylistVersion", raw_input: version.to_string(), })?; @@ -56,7 +56,7 @@ impl CommandRequest for PlChangesRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), }) }) diff --git a/src/commands/queue/plchangesposid.rs b/src/commands/queue/plchangesposid.rs index f30d44b..aae1296 100644 --- a/src/commands/queue/plchangesposid.rs +++ b/src/commands/queue/plchangesposid.rs @@ -46,7 +46,7 @@ impl CommandRequest for PlChangesPosIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "PlaylistVersion".to_string(), + expected_type: "PlaylistVersion", raw_input: version.to_string(), })?; @@ -56,7 +56,7 @@ impl CommandRequest for PlChangesPosIdRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), }) }) diff --git a/src/commands/queue/prio.rs b/src/commands/queue/prio.rs index 094f320..b7748cd 100644 --- a/src/commands/queue/prio.rs +++ b/src/commands/queue/prio.rs @@ -40,7 +40,7 @@ impl CommandRequest for PrioRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "Priority".to_string(), + expected_type: "Priority", raw_input: prio.to_string(), })?; @@ -49,7 +49,7 @@ impl CommandRequest for PrioRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: window.to_string(), })?; diff --git a/src/commands/queue/prioid.rs b/src/commands/queue/prioid.rs index 4eb259c..eb5c374 100644 --- a/src/commands/queue/prioid.rs +++ b/src/commands/queue/prioid.rs @@ -47,7 +47,7 @@ impl CommandRequest for PrioIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "Priority".to_string(), + expected_type: "Priority", raw_input: prio.to_string(), })?; diff --git a/src/commands/queue/rangeid.rs b/src/commands/queue/rangeid.rs index bf21e76..6cd08c2 100644 --- a/src/commands/queue/rangeid.rs +++ b/src/commands/queue/rangeid.rs @@ -43,7 +43,7 @@ impl CommandRequest for RangeIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: songid.to_string(), })?; @@ -53,7 +53,7 @@ impl CommandRequest for RangeIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "TimeInterval".to_string(), + expected_type: "TimeInterval", raw_input: time_interval.to_string(), })?; diff --git a/src/commands/queue/swap.rs b/src/commands/queue/swap.rs index c2384b2..0633413 100644 --- a/src/commands/queue/swap.rs +++ b/src/commands/queue/swap.rs @@ -40,7 +40,7 @@ impl CommandRequest for SwapRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: songpos1.to_string(), })?; @@ -49,7 +49,7 @@ impl CommandRequest for SwapRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: songpos2.to_string(), })?; diff --git a/src/commands/queue/swapid.rs b/src/commands/queue/swapid.rs index 125fdde..2cf91d6 100644 --- a/src/commands/queue/swapid.rs +++ b/src/commands/queue/swapid.rs @@ -40,7 +40,7 @@ impl CommandRequest for SwapIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: songid1.to_string(), })?; @@ -49,7 +49,7 @@ impl CommandRequest for SwapIdRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "SongId".to_string(), + expected_type: "SongId", raw_input: songid2.to_string(), })?; diff --git a/src/commands/stickers/sticker_dec.rs b/src/commands/stickers/sticker_dec.rs index 2e550b0..7191e0f 100644 --- a/src/commands/stickers/sticker_dec.rs +++ b/src/commands/stickers/sticker_dec.rs @@ -55,7 +55,7 @@ impl CommandRequest for StickerDecRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -64,7 +64,7 @@ impl CommandRequest for StickerDecRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -73,7 +73,7 @@ impl CommandRequest for StickerDecRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; @@ -82,7 +82,7 @@ impl CommandRequest for StickerDecRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 3, - expected_type: "usize".to_string(), + expected_type: "usize", raw_input: value.to_string(), })?; diff --git a/src/commands/stickers/sticker_delete.rs b/src/commands/stickers/sticker_delete.rs index abef984..40a5a01 100644 --- a/src/commands/stickers/sticker_delete.rs +++ b/src/commands/stickers/sticker_delete.rs @@ -52,7 +52,7 @@ impl CommandRequest for StickerDeleteRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -61,7 +61,7 @@ impl CommandRequest for StickerDeleteRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -70,7 +70,7 @@ impl CommandRequest for StickerDeleteRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; diff --git a/src/commands/stickers/sticker_find.rs b/src/commands/stickers/sticker_find.rs index 70834a3..65f0928 100644 --- a/src/commands/stickers/sticker_find.rs +++ b/src/commands/stickers/sticker_find.rs @@ -73,7 +73,7 @@ impl CommandRequest for StickerFindRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -82,7 +82,7 @@ impl CommandRequest for StickerFindRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -91,7 +91,7 @@ impl CommandRequest for StickerFindRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; @@ -110,7 +110,7 @@ impl CommandRequest for StickerFindRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "Sort".to_string(), + expected_type: "Sort", raw_input: s.to_string(), })?, ); @@ -130,7 +130,7 @@ impl CommandRequest for StickerFindRequest { w.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: argument_index_counter, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: w.to_string(), })?, ); diff --git a/src/commands/stickers/sticker_get.rs b/src/commands/stickers/sticker_get.rs index f637aae..7e91174 100644 --- a/src/commands/stickers/sticker_get.rs +++ b/src/commands/stickers/sticker_get.rs @@ -52,7 +52,7 @@ impl CommandRequest for StickerGetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -61,7 +61,7 @@ impl CommandRequest for StickerGetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -70,7 +70,7 @@ impl CommandRequest for StickerGetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; diff --git a/src/commands/stickers/sticker_inc.rs b/src/commands/stickers/sticker_inc.rs index db62d80..67a66e5 100644 --- a/src/commands/stickers/sticker_inc.rs +++ b/src/commands/stickers/sticker_inc.rs @@ -55,7 +55,7 @@ impl CommandRequest for StickerIncRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -64,7 +64,7 @@ impl CommandRequest for StickerIncRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -73,7 +73,7 @@ impl CommandRequest for StickerIncRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; @@ -82,7 +82,7 @@ impl CommandRequest for StickerIncRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 3, - expected_type: "usize".to_string(), + expected_type: "usize", raw_input: value.to_string(), })?; diff --git a/src/commands/stickers/sticker_list.rs b/src/commands/stickers/sticker_list.rs index 675fb86..1f8376e 100644 --- a/src/commands/stickers/sticker_list.rs +++ b/src/commands/stickers/sticker_list.rs @@ -46,7 +46,7 @@ impl CommandRequest for StickerListRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -55,7 +55,7 @@ impl CommandRequest for StickerListRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; diff --git a/src/commands/stickers/sticker_set.rs b/src/commands/stickers/sticker_set.rs index 29a5659..53eb581 100644 --- a/src/commands/stickers/sticker_set.rs +++ b/src/commands/stickers/sticker_set.rs @@ -55,7 +55,7 @@ impl CommandRequest for StickerSetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "StickerType".to_string(), + expected_type: "StickerType", raw_input: sticker_type.to_string(), })?; @@ -64,7 +64,7 @@ impl CommandRequest for StickerSetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 1, - expected_type: "Uri".to_string(), + expected_type: "Uri", raw_input: uri.to_string(), })?; @@ -73,7 +73,7 @@ impl CommandRequest for StickerSetRequest { .parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "String".to_string(), + expected_type: "String", raw_input: name.to_string(), })?; diff --git a/src/commands/stored_playlists/playlistadd.rs b/src/commands/stored_playlists/playlistadd.rs index 0d956b6..f360969 100644 --- a/src/commands/stored_playlists/playlistadd.rs +++ b/src/commands/stored_playlists/playlistadd.rs @@ -69,7 +69,7 @@ impl CommandRequest for PlaylistAddRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 2, - expected_type: "SongPosition".to_string(), + expected_type: "SongPosition", raw_input: s.to_string(), }) }) diff --git a/src/commands/stored_playlists/searchplaylist.rs b/src/commands/stored_playlists/searchplaylist.rs index 0da8701..a7a40df 100644 --- a/src/commands/stored_playlists/searchplaylist.rs +++ b/src/commands/stored_playlists/searchplaylist.rs @@ -51,7 +51,7 @@ impl CommandRequest for SearchPlaylistRequest { name.parse::() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "PlaylistName".to_string(), + expected_type: "PlaylistName", raw_input: name.to_string(), })?; @@ -68,7 +68,7 @@ impl CommandRequest for SearchPlaylistRequest { s.parse() .map_err(|_| RequestParserError::SubtypeParserError { argument_index: 0, - expected_type: "WindowRange".to_string(), + expected_type: "WindowRange", raw_input: s.to_string(), }) })