Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add `timestamp` method to `Issues`
Sebastian Martinez committed 3 years ago
commit 432e6aafbb6c59c1484d3e5f880d9027460f67f6
parent 7cb7d3a4a27ab33c91c7041896e5573c80fbc00e
1 file changed +10 -1
modified radicle/src/cob/issue.rs
@@ -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()