refactor: replace try_swap_remove

This commit is contained in:
ThetaDev 2023-05-07 18:15:13 +02:00
parent 0008e305c2
commit 29ad2f99d4
9 changed files with 87 additions and 61 deletions

View file

@ -129,11 +129,11 @@ impl MapResponse<VideoDetails> for response::VideoDetails {
}
response::video_details::VideoResultsItem::ItemSectionRenderer(section) => {
match section {
response::video_details::ItemSection::CommentsEntryPoint { mut contents } => {
comment_count_section = contents.try_swap_remove(0);
response::video_details::ItemSection::CommentsEntryPoint { contents } => {
comment_count_section = contents.into_iter().next();
}
response::video_details::ItemSection::CommentItemSection { mut contents } => {
comment_ctoken_section = contents.try_swap_remove(0);
response::video_details::ItemSection::CommentItemSection { contents } => {
comment_ctoken_section = contents.into_iter().next();
}
response::video_details::ItemSection::None => {}
}