Add `timestamp` method to `Issues`
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
parent
7cb7d3a4a2
commit
432e6aafbb
|
|
@ -9,7 +9,7 @@ use radicle_crdt::clock;
|
|||
use radicle_crdt::{LWWReg, LWWSet, Max, Semilattice};
|
||||
|
||||
use crate::cob;
|
||||
use crate::cob::common::{Author, Reaction, Tag};
|
||||
use crate::cob::common::{Author, Reaction, Tag, Timestamp};
|
||||
use crate::cob::store::FromHistory as _;
|
||||
use crate::cob::store::Transaction;
|
||||
use crate::cob::thread;
|
||||
|
|
@ -175,6 +175,15 @@ impl Issue {
|
|||
self.tags.iter()
|
||||
}
|
||||
|
||||
pub fn timestamp(&self) -> Timestamp {
|
||||
self.thread
|
||||
.comments()
|
||||
.next()
|
||||
.map(|(_, c)| c)
|
||||
.expect("Issue::timestamp: at least one comment is present")
|
||||
.timestamp()
|
||||
}
|
||||
|
||||
pub fn author(&self) -> Author {
|
||||
self.thread
|
||||
.comments()
|
||||
|
|
|
|||
Loading…
Reference in New Issue