cob: Create proper OpId type

To still access a comment's author, we add a new `author` field.
This commit is contained in:
Alexis Sellier
2022-12-31 09:58:51 +01:00
committed by Alexis Sellier
parent a93803c8ca
commit 134bb7a847
+4 -2
View File
@@ -423,9 +423,11 @@ impl<'a> FromIterator<(&'a CommentId, &'a thread::Comment)> for Comments {
fn from_iter<I: IntoIterator<Item = (&'a CommentId, &'a thread::Comment)>>(iter: I) -> Self {
let mut comments = Vec::new();
for (comment_id, comment) in iter {
for (_, comment) in iter {
comments.push(Comment {
author: Author { id: comment_id.1 },
author: Author {
id: comment.author(),
},
body: comment.body().to_owned(),
reactions: [],
timestamp: comment.timestamp(),