From c1dbdd46444abb3a21c4569a038e86d93fc17a49 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 7 Dec 2025 21:39:57 +0900 Subject: [PATCH] cargo fmt --- src/commands.rs | 2 +- src/commands/music_database/listall.rs | 2 -- src/commands/music_database/listallinfo.rs | 2 -- src/commands/music_database/listfiles.rs | 2 -- src/commands/music_database/lsinfo.rs | 3 --- .../stored_playlists/playlistdelete.rs | 2 +- src/request.rs | 27 +++++++++---------- 7 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 5889c0f..77ac391 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,4 +1,4 @@ -use crate::{Request, request_tokenizer::RequestTokenizer, response_tokenizer::ResponseAttributes}; +use crate::{request_tokenizer::RequestTokenizer, response_tokenizer::ResponseAttributes}; mod audio_output_devices; mod client_to_client; diff --git a/src/commands/music_database/listall.rs b/src/commands/music_database/listall.rs index a23519b..95f3d82 100644 --- a/src/commands/music_database/listall.rs +++ b/src/commands/music_database/listall.rs @@ -41,8 +41,6 @@ impl Command for ListAll { fn parse_response( parts: ResponseAttributes<'_>, ) -> Result> { - - DbSelectionPrintResponse::parse(parts) } } diff --git a/src/commands/music_database/listallinfo.rs b/src/commands/music_database/listallinfo.rs index e051694..6867f56 100644 --- a/src/commands/music_database/listallinfo.rs +++ b/src/commands/music_database/listallinfo.rs @@ -40,8 +40,6 @@ impl Command for ListAllInfo { fn parse_response( parts: ResponseAttributes<'_>, ) -> Result> { - - DbSelectionPrintResponse::parse(parts) } } diff --git a/src/commands/music_database/listfiles.rs b/src/commands/music_database/listfiles.rs index aa206da..ab4bf94 100644 --- a/src/commands/music_database/listfiles.rs +++ b/src/commands/music_database/listfiles.rs @@ -41,8 +41,6 @@ impl Command for ListFiles { fn parse_response( parts: ResponseAttributes<'_>, ) -> Result> { - - // TODO: debug assert only toplevel dirs DbSelectionPrintResponse::parse(parts)? diff --git a/src/commands/music_database/lsinfo.rs b/src/commands/music_database/lsinfo.rs index 95db079..6fb8e26 100644 --- a/src/commands/music_database/lsinfo.rs +++ b/src/commands/music_database/lsinfo.rs @@ -1,4 +1,3 @@ - use crate::{ DbSelectionPrintResponse, commands::{Command, RequestParserError, ResponseParserError}, @@ -40,8 +39,6 @@ impl Command for LsInfo { fn parse_response( parts: ResponseAttributes<'_>, ) -> Result> { - - // TODO: debug_assert no song variants // debug_assert!( // result.iter(). diff --git a/src/commands/stored_playlists/playlistdelete.rs b/src/commands/stored_playlists/playlistdelete.rs index 2d3e109..cbb48a9 100644 --- a/src/commands/stored_playlists/playlistdelete.rs +++ b/src/commands/stored_playlists/playlistdelete.rs @@ -44,7 +44,7 @@ impl Command for PlaylistDelete { debug_assert!(parts.next().is_none()); Ok(PlaylistDeleteRequest { - playlist_name: playlist_name, + playlist_name, position, }) } diff --git a/src/request.rs b/src/request.rs index 22538cc..8a314fa 100644 --- a/src/request.rs +++ b/src/request.rs @@ -203,22 +203,21 @@ pub enum Request { } impl Request { + // pub enum RequestParserError { + // SyntaxError(u64, String), + // MissingCommandListEnd(u64), + // NestedCommandList(u64), + // UnexpectedCommandListEnd(u64), + // UnexpectedEOF, + // MissingNewline, + // } -// pub enum RequestParserError { -// SyntaxError(u64, String), -// MissingCommandListEnd(u64), -// NestedCommandList(u64), -// UnexpectedCommandListEnd(u64), -// UnexpectedEOF, -// MissingNewline, -// } + // TODO: upon encountering an error, there should be a function that lets you skip to the next OK, + // and continue execution. Maybe "parse_next_or_skip(&str) -> RequestParserResponse", which + // could skip stuff internally? Or do we want to report back the error with the entire command + // and let the library user decide what to do? -// TODO: upon encountering an error, there should be a function that lets you skip to the next OK, -// and continue execution. Maybe "parse_next_or_skip(&str) -> RequestParserResponse", which -// could skip stuff internally? Or do we want to report back the error with the entire command -// and let the library user decide what to do? - -// impl Request { + // impl Request { // pub fn parse_next(raw: &str) -> Result { // let (line, rest) = raw // .split_once('\n')