mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-08 21:20:45 +08:00
Reduce pub accessors in patch and issue cob structs
Replaces pub accessors to struct fields with methods Also creates some methods to compute necessary information Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
committed by
Alexis Sellier
parent
f7fc778c3b
commit
fff45817bc
@@ -121,15 +121,14 @@ pub(crate) fn patch(id: PatchId, patch: Patch, repo: &git::Repository) -> Value
|
||||
json!({
|
||||
"id": id,
|
||||
"description": rev.description(),
|
||||
"base": rev.base,
|
||||
"oid": rev.oid,
|
||||
"refs": get_refs(repo, patch.author().id(), &rev.oid).unwrap_or(vec![]),
|
||||
"base": rev.base(),
|
||||
"oid": rev.head(),
|
||||
"refs": get_refs(repo, patch.author().id(), &rev.head()).unwrap_or(vec![]),
|
||||
"merges": rev.merges().collect::<Vec<_>>(),
|
||||
"discussions": rev.discussion
|
||||
.comments()
|
||||
.map(|(id, comment)| Comment::new(id, comment, &rev.discussion))
|
||||
"discussions": rev.discussion().comments()
|
||||
.map(|(id, comment)| Comment::new(id, comment, rev.discussion()))
|
||||
.collect::<Vec<_>>(),
|
||||
"timestamp": rev.timestamp,
|
||||
"timestamp": rev.timestamp(),
|
||||
"reviews": rev.reviews().collect::<Vec<_>>(),
|
||||
})
|
||||
}).collect::<Vec<_>>(),
|
||||
|
||||
Reference in New Issue
Block a user