commands: store SubtypeParserError expected type as &str
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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))?;
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ impl CommandRequest for PauseRequest {
|
||||
Some("1") => Ok(Some(true)),
|
||||
Some(s) => Err(RequestParserError::SubtypeParserError {
|
||||
argument_index: 0,
|
||||
expected_type: "Option<bool>".to_owned(),
|
||||
expected_type: "Option<bool>",
|
||||
raw_input: s.to_owned(),
|
||||
}),
|
||||
None => Ok(None),
|
||||
|
||||
@@ -40,7 +40,7 @@ impl CommandRequest for SeekRequest {
|
||||
s.parse::<SongPosition>()
|
||||
.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::<TimeWithFractions>().map_err(|_| {
|
||||
RequestParserError::SubtypeParserError {
|
||||
argument_index: 1,
|
||||
expected_type: "TimeWithFractions".to_string(),
|
||||
expected_type: "TimeWithFractions",
|
||||
raw_input: t.to_owned(),
|
||||
}
|
||||
})?,
|
||||
|
||||
@@ -55,7 +55,7 @@ impl CommandRequest for SeekCurRequest {
|
||||
t[1..].parse::<TimeWithFractions>().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::<TimeWithFractions>().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::<TimeWithFractions>().map_err(|_| {
|
||||
RequestParserError::SubtypeParserError {
|
||||
argument_index: 0,
|
||||
expected_type: "TimeWithFractions".to_string(),
|
||||
expected_type: "TimeWithFractions",
|
||||
raw_input: t.to_owned(),
|
||||
}
|
||||
})?,
|
||||
|
||||
@@ -40,7 +40,7 @@ impl CommandRequest for SeekIdRequest {
|
||||
.parse::<SongId>()
|
||||
.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::<TimeWithFractions>().map_err(|_| {
|
||||
RequestParserError::SubtypeParserError {
|
||||
argument_index: 1,
|
||||
expected_type: "TimeWithFractions".to_string(),
|
||||
expected_type: "TimeWithFractions",
|
||||
raw_input: t.to_owned(),
|
||||
}
|
||||
})?,
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ impl CommandRequest for UnmountRequest {
|
||||
path.parse::<MountPath>()
|
||||
.map_err(|_| RequestParserError::SubtypeParserError {
|
||||
argument_index: 0,
|
||||
expected_type: "MountPath".to_string(),
|
||||
expected_type: "MountPath",
|
||||
raw_input: path.to_string(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ impl CommandRequest for AlbumArtRequest {
|
||||
.parse::<Offset>()
|
||||
.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)),
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
)
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -50,7 +50,7 @@ impl CommandRequest for ReadPictureRequest {
|
||||
.parse::<Offset>()
|
||||
.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)),
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
)
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl CommandRequest for AddRequest {
|
||||
Some(s) => Some(s.parse::<SongPosition>().map_err(|_| {
|
||||
RequestParserError::SubtypeParserError {
|
||||
argument_index: 1,
|
||||
expected_type: "SongPosition".to_string(),
|
||||
expected_type: "SongPosition",
|
||||
raw_input: s.to_owned(),
|
||||
}
|
||||
})?),
|
||||
|
||||
@@ -48,7 +48,7 @@ impl CommandRequest for AddIdRequest {
|
||||
Some(s) => Some(s.parse::<SongPosition>().map_err(|_| {
|
||||
RequestParserError::SubtypeParserError {
|
||||
argument_index: 1,
|
||||
expected_type: "SongPosition".to_string(),
|
||||
expected_type: "SongPosition",
|
||||
raw_input: s.to_owned(),
|
||||
}
|
||||
})?),
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?,
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -51,7 +51,7 @@ impl CommandRequest for SearchPlaylistRequest {
|
||||
name.parse::<PlaylistName>()
|
||||
.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(),
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user