commit f2258ab16b11b9dca02143d18dfeac7df6772d2d
parent 571435cf85bcd2d399aa3052936b46429ee7c44a
Author: kernelkind <kernelkind@gmail.com>
Date: Thu, 4 Sep 2025 15:06:48 -0400
add `NotePayload::noteref` helper
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/crates/notedeck_columns/src/timeline/timeline_units.rs b/crates/notedeck_columns/src/timeline/timeline_units.rs
@@ -99,6 +99,15 @@ pub struct NotePayload<'a> {
pub key: NoteKey,
}
+impl<'a> NotePayload<'a> {
+ pub fn noteref(&self) -> NoteRef {
+ NoteRef {
+ key: self.key,
+ created_at: self.note.created_at(),
+ }
+ }
+}
+
fn to_fragment<'a>(
payload: &'a NotePayload,
ndb: &Ndb,
@@ -147,10 +156,7 @@ fn to_reaction<'a>(
let reacted_to_noteid = note_reacted_to?;
- let reaction_note_ref = NoteRef {
- key: payload.key,
- created_at: payload.note.created_at(),
- };
+ let reaction_note_ref = payload.noteref();
let reacted_to_note = ndb.get_note_by_id(txn, reacted_to_noteid).ok()?;