From 134bb7a847e3afcadf339bad521346c657d57c85 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Fri, 30 Dec 2022 13:30:35 +0100 Subject: [PATCH] cob: Create proper `OpId` type To still access a comment's author, we add a new `author` field. --- radicle-httpd/src/api/v1/projects.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 0518e62a2..1e7de595d 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -423,9 +423,11 @@ impl<'a> FromIterator<(&'a CommentId, &'a thread::Comment)> for Comments { fn from_iter>(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(),