1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
use crate::pixiv::helper_structs::comment::Comment;
use serde::{Deserialize, Serialize};

/// IllustrationComment
#[derive(Serialize, Deserialize, Debug)]
pub struct IllustrationComment {
    comments: Vec<Comment>,
    next_url: String,
    total_comments: u32,
}

impl IntoIterator for IllustrationComment {
    type Item = Comment;
    type IntoIter = std::vec::IntoIter<Self::Item>;

    /// Consume the struct, yielding an iterator.
    fn into_iter(self) -> Self::IntoIter {
        self.comments.into_iter()
    }
}