common/types: add type for Sort

This commit is contained in:
2025-11-25 03:56:01 +09:00
parent 59a347f610
commit e56b9ab6c4
10 changed files with 105 additions and 33 deletions
+3 -4
View File
@@ -45,11 +45,10 @@ impl Command for PlaylistFind {
let mut sort_or_window = parts.next();
let mut sort = None;
if let Some("sort") = sort_or_window {
let s = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
sort = Some(
parts
.next()
.ok_or(RequestParserError::UnexpectedEOF)?
.to_string(),
s.parse()
.map_err(|_| RequestParserError::SyntaxError(0, s.to_string()))?,
);
sort_or_window = parts.next();
}
+3 -4
View File
@@ -45,11 +45,10 @@ impl Command for PlaylistSearch {
let mut sort_or_window = parts.next();
let mut sort = None;
if let Some("sort") = sort_or_window {
let s = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
sort = Some(
parts
.next()
.ok_or(RequestParserError::UnexpectedEOF)?
.to_string(),
s.parse()
.map_err(|_| RequestParserError::SyntaxError(0, s.to_string()))?,
);
sort_or_window = parts.next();
}