common/types: add type for Sort
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user