commands: strip lifetimes

This commit is contained in:
2025-12-08 12:30:19 +09:00
parent 46803e0a30
commit e59d04e830
133 changed files with 269 additions and 271 deletions

View File

@@ -14,7 +14,7 @@ pub struct AddRequest {
position: Option<SongPosition>,
}
impl CommandRequest<'_> for AddRequest {
impl CommandRequest for AddRequest {
const COMMAND: &'static str = "add";
fn into_request_enum(self) -> crate::Request {
@@ -60,7 +60,7 @@ impl CommandRequest<'_> for AddRequest {
empty_command_response!(Add);
impl Command<'_, '_> for Add {
impl Command for Add {
type Request = AddRequest;
type Response = AddResponse;
}

View File

@@ -15,7 +15,7 @@ pub struct AddIdRequest {
pub position: Option<SongPosition>,
}
impl CommandRequest<'_> for AddIdRequest {
impl CommandRequest for AddIdRequest {
const COMMAND: &'static str = "addid";
fn into_request_enum(self) -> crate::Request {
@@ -64,7 +64,7 @@ pub struct AddIdResponse {
pub id: SongId,
}
impl CommandResponse<'_> for AddIdResponse {
impl CommandResponse for AddIdResponse {
fn into_response_enum(self) -> crate::Response {
todo!()
}
@@ -84,7 +84,7 @@ impl CommandResponse<'_> for AddIdResponse {
}
}
impl Command<'_, '_> for AddId {
impl Command for AddId {
type Request = AddIdRequest;
type Response = AddIdResponse;
}

View File

@@ -15,7 +15,7 @@ pub struct AddTagIdRequest {
pub tag_value: TagValue,
}
impl CommandRequest<'_> for AddTagIdRequest {
impl CommandRequest for AddTagIdRequest {
const COMMAND: &'static str = "addtagid";
fn into_request_enum(self) -> crate::Request {
@@ -71,7 +71,7 @@ impl CommandRequest<'_> for AddTagIdRequest {
empty_command_response!(AddTagId);
impl Command<'_, '_> for AddTagId {
impl Command for AddTagId {
type Request = AddTagIdRequest;
type Response = AddTagIdResponse;
}

View File

@@ -6,7 +6,7 @@ empty_command_request!(Clear, "clear");
empty_command_response!(Clear);
impl Command<'_, '_> for Clear {
impl Command for Clear {
type Request = ClearRequest;
type Response = ClearResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct ClearTagIdRequest {
pub tag_name: TagName,
}
impl CommandRequest<'_> for ClearTagIdRequest {
impl CommandRequest for ClearTagIdRequest {
const COMMAND: &'static str = "cleartagid";
fn into_request_enum(self) -> crate::Request {
@@ -53,7 +53,7 @@ impl CommandRequest<'_> for ClearTagIdRequest {
empty_command_response!(ClearTagId);
impl Command<'_, '_> for ClearTagId {
impl Command for ClearTagId {
type Request = ClearTagIdRequest;
type Response = ClearTagIdResponse;
}

View File

@@ -9,7 +9,7 @@ single_item_command_request!(Delete, "delete", OneOrRange);
empty_command_response!(Delete);
impl Command<'_, '_> for Delete {
impl Command for Delete {
type Request = DeleteRequest;
type Response = DeleteResponse;
}

View File

@@ -9,7 +9,7 @@ single_item_command_request!(DeleteId, "deleteid", SongId);
empty_command_response!(DeleteId);
impl Command<'_, '_> for DeleteId {
impl Command for DeleteId {
type Request = DeleteIdRequest;
type Response = DeleteIdResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct MoveRequest {
pub to: AbsouluteRelativeSongPosition,
}
impl CommandRequest<'_> for MoveRequest {
impl CommandRequest for MoveRequest {
const COMMAND: &'static str = "move";
fn into_request_enum(self) -> crate::Request {
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for MoveRequest {
empty_command_response!(Move);
impl Command<'_, '_> for Move {
impl Command for Move {
type Request = MoveRequest;
type Response = MoveResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct MoveIdRequest {
pub to: AbsouluteRelativeSongPosition,
}
impl CommandRequest<'_> for MoveIdRequest {
impl CommandRequest for MoveIdRequest {
const COMMAND: &'static str = "moveid";
fn into_request_enum(self) -> crate::Request {
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for MoveIdRequest {
empty_command_response!(MoveId);
impl Command<'_, '_> for MoveId {
impl Command for MoveId {
type Request = MoveIdRequest;
type Response = MoveIdResponse;
}

View File

@@ -13,7 +13,7 @@ empty_command_request!(Playlist, "playlist");
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PlaylistResponse(Vec<Uri>);
impl CommandResponse<'_> for PlaylistResponse {
impl CommandResponse for PlaylistResponse {
fn into_response_enum(self) -> crate::Response {
todo!()
}
@@ -27,7 +27,7 @@ impl CommandResponse<'_> for PlaylistResponse {
}
}
impl Command<'_, '_> for Playlist {
impl Command for Playlist {
type Request = PlaylistRequest;
type Response = PlaylistResponse;
}

View File

@@ -18,7 +18,7 @@ pub struct PlaylistFindRequest {
window: Option<WindowRange>,
}
impl CommandRequest<'_> for PlaylistFindRequest {
impl CommandRequest for PlaylistFindRequest {
const COMMAND: &'static str = "playlistfind";
fn into_request_enum(self) -> crate::Request {
@@ -44,7 +44,7 @@ impl CommandRequest<'_> for PlaylistFindRequest {
if let Some(window) = &self.window {
cmd.push_str(&format!(" window {}", window));
}
cmd.push_str("\n");
cmd.push('\n');
cmd
}
@@ -97,7 +97,7 @@ pub struct PlaylistFindResponseEntry {
pub song_info: DbSongInfo,
}
impl CommandResponse<'_> for PlaylistFindResponse {
impl CommandResponse for PlaylistFindResponse {
fn into_response_enum(self) -> Response {
todo!()
}
@@ -111,7 +111,7 @@ impl CommandResponse<'_> for PlaylistFindResponse {
}
}
impl Command<'_, '_> for PlaylistFind {
impl Command for PlaylistFind {
type Request = PlaylistFindRequest;
type Response = PlaylistFindResponse;
}

View File

@@ -21,7 +21,7 @@ pub struct PlaylistIdResponseEntry {
pub song_info: DbSongInfo,
}
impl CommandResponse<'_> for PlaylistIdResponse {
impl CommandResponse for PlaylistIdResponse {
fn into_response_enum(self) -> crate::Response {
todo!()
}
@@ -35,7 +35,7 @@ impl CommandResponse<'_> for PlaylistIdResponse {
}
}
impl Command<'_, '_> for PlaylistId {
impl Command for PlaylistId {
type Request = PlaylistIdRequest;
type Response = PlaylistIdResponse;
}

View File

@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
use crate::{
commands::{
Command, CommandResponse, RequestParserError, ResponseParserError,
Command, CommandResponse, ResponseParserError,
single_optional_item_command_request,
},
response_tokenizer::ResponseAttributes,
@@ -24,7 +24,7 @@ pub struct PlaylistInfoResponseEntry {
pub song_info: DbSongInfo,
}
impl CommandResponse<'_> for PlaylistInfoResponse {
impl CommandResponse for PlaylistInfoResponse {
fn into_response_enum(self) -> crate::Response {
todo!()
}
@@ -38,7 +38,7 @@ impl CommandResponse<'_> for PlaylistInfoResponse {
}
}
impl Command<'_, '_> for PlaylistInfo {
impl Command for PlaylistInfo {
type Request = PlaylistInfoRequest;
type Response = PlaylistInfoResponse;
}

View File

@@ -17,7 +17,7 @@ pub struct PlaylistSearchRequest {
window: Option<WindowRange>,
}
impl CommandRequest<'_> for PlaylistSearchRequest {
impl CommandRequest for PlaylistSearchRequest {
const COMMAND: &'static str = "playlistsearch";
fn into_request_enum(self) -> crate::Request {
@@ -43,7 +43,7 @@ impl CommandRequest<'_> for PlaylistSearchRequest {
if let Some(window) = &self.window {
cmd.push_str(&format!(" window {}", window));
}
cmd.push_str("\n");
cmd.push('\n');
cmd
}
@@ -96,7 +96,7 @@ pub struct PlaylistSearchResponseEntry {
pub song_info: DbSongInfo,
}
impl CommandResponse<'_> for PlaylistSearchResponse {
impl CommandResponse for PlaylistSearchResponse {
fn from_response_enum(response: crate::Response) -> Option<Self> {
todo!()
}
@@ -110,7 +110,7 @@ impl CommandResponse<'_> for PlaylistSearchResponse {
}
}
impl Command<'_, '_> for PlaylistSearch {
impl Command for PlaylistSearch {
type Request = PlaylistSearchRequest;
type Response = PlaylistSearchResponse;
}

View File

@@ -15,7 +15,7 @@ pub struct PlChangesRequest {
pub window: Option<WindowRange>,
}
impl CommandRequest<'_> for PlChangesRequest {
impl CommandRequest for PlChangesRequest {
const COMMAND: &'static str = "plchanges";
fn into_request_enum(self) -> crate::Request {
@@ -69,7 +69,7 @@ pub struct PlChangesResponseEntry {
pub song_info: DbSongInfo,
}
impl CommandResponse<'_> for PlChangesResponse {
impl CommandResponse for PlChangesResponse {
fn from_response_enum(response: crate::Response) -> Option<Self> {
todo!()
}
@@ -83,7 +83,7 @@ impl CommandResponse<'_> for PlChangesResponse {
}
}
impl Command<'_, '_> for PlChanges {
impl Command for PlChanges {
type Request = PlChangesRequest;
type Response = PlChangesResponse;
}

View File

@@ -15,7 +15,7 @@ pub struct PlChangesPosIdRequest {
pub window: Option<WindowRange>,
}
impl CommandRequest<'_> for PlChangesPosIdRequest {
impl CommandRequest for PlChangesPosIdRequest {
const COMMAND: &'static str = "plchangesposid";
fn into_request_enum(self) -> crate::Request {
@@ -68,7 +68,7 @@ pub struct PlChangesPosIdResponseEntry {
pub id: SongId,
}
impl CommandResponse<'_> for PlChangesPosIdResponse {
impl CommandResponse for PlChangesPosIdResponse {
fn from_response_enum(response: crate::Response) -> Option<Self> {
todo!()
}
@@ -82,7 +82,7 @@ impl CommandResponse<'_> for PlChangesPosIdResponse {
}
}
impl Command<'_, '_> for PlChangesPosId {
impl Command for PlChangesPosId {
type Request = PlChangesPosIdRequest;
type Response = PlChangesPosIdResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct PrioRequest {
pub window: WindowRange,
}
impl CommandRequest<'_> for PrioRequest {
impl CommandRequest for PrioRequest {
const COMMAND: &'static str = "prio";
fn into_request_enum(self) -> crate::Request {
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for PrioRequest {
empty_command_response!(Prio);
impl Command<'_, '_> for Prio {
impl Command for Prio {
type Request = PrioRequest;
type Response = PrioResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct PrioIdRequest {
pub songids: Vec<SongId>,
}
impl CommandRequest<'_> for PrioIdRequest {
impl CommandRequest for PrioIdRequest {
const COMMAND: &'static str = "prioid";
fn into_request_enum(self) -> crate::Request {
@@ -61,7 +61,7 @@ impl CommandRequest<'_> for PrioIdRequest {
empty_command_response!(PrioId);
impl Command<'_, '_> for PrioId {
impl Command for PrioId {
type Request = PrioIdRequest;
type Response = PrioIdResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct RangeIdRequest {
time_interval: TimeInterval,
}
impl CommandRequest<'_> for RangeIdRequest {
impl CommandRequest for RangeIdRequest {
const COMMAND: &'static str = "rangeid";
fn into_request_enum(self) -> crate::Request {
@@ -57,7 +57,7 @@ impl CommandRequest<'_> for RangeIdRequest {
empty_command_response!(RangeId);
impl Command<'_, '_> for RangeId {
impl Command for RangeId {
type Request = RangeIdRequest;
type Response = RangeIdResponse;
}

View File

@@ -1,6 +1,6 @@
use crate::{
commands::{
Command, RequestParserError, empty_command_response, single_optional_item_command_request,
Command, empty_command_response, single_optional_item_command_request,
},
types::OneOrRange,
};
@@ -11,7 +11,7 @@ single_optional_item_command_request!(Shuffle, "shuffle", OneOrRange);
empty_command_response!(Shuffle);
impl Command<'_, '_> for Shuffle {
impl Command for Shuffle {
type Request = ShuffleRequest;
type Response = ShuffleResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct SwapRequest {
pub songpos2: SongPosition,
}
impl CommandRequest<'_> for SwapRequest {
impl CommandRequest for SwapRequest {
const COMMAND: &'static str = "swap";
fn into_request_enum(self) -> crate::Request {
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for SwapRequest {
empty_command_response!(Swap);
impl Command<'_, '_> for Swap {
impl Command for Swap {
type Request = SwapRequest;
type Response = SwapResponse;
}

View File

@@ -14,7 +14,7 @@ pub struct SwapIdRequest {
pub songid2: SongId,
}
impl CommandRequest<'_> for SwapIdRequest {
impl CommandRequest for SwapIdRequest {
const COMMAND: &'static str = "swapid";
fn into_request_enum(self) -> crate::Request {
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for SwapIdRequest {
empty_command_response!(SwapId);
impl Command<'_, '_> for SwapId {
impl Command for SwapId {
type Request = SwapIdRequest;
type Response = SwapIdResponse;
}