fix: add model conversion, generic string arg

This commit is contained in:
ThetaDev 2023-03-10 19:04:27 +01:00
parent 3458924018
commit 630ea5960f
2 changed files with 17 additions and 6 deletions

View file

@ -29,7 +29,8 @@ struct QVideo<'a> {
impl RustyPipeQuery {
/// Get the metadata for a video
pub async fn video_details(&self, video_id: &str) -> Result<VideoDetails, Error> {
pub async fn video_details<S: AsRef<str>>(&self, video_id: S) -> Result<VideoDetails, Error> {
let video_id = video_id.as_ref();
let context = self.get_context(ClientType::Desktop, true, None).await;
let request_body = QVideo {
context,
@ -49,11 +50,12 @@ impl RustyPipeQuery {
}
/// Get the comments for a video using the continuation token obtained from `rusty_pipe_query.video_details()`
pub async fn video_comments(
pub async fn video_comments<S: AsRef<str>>(
&self,
ctoken: &str,
ctoken: S,
visitor_data: Option<&str>,
) -> Result<Paginator<Comment>, Error> {
let ctoken = ctoken.as_ref();
let context = self
.get_context(ClientType::Desktop, true, visitor_data)
.await;