diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-08-21 23:47:15 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-08-24 04:50:49 -0400 |
| commit | 53944ef14af4d37c08464cb1bb9f3a8f09277194 (patch) | |
| tree | 8458167c1608222a914ce0bdcc1fb5f966cf4f95 /src/conversation/history.rs | |
| parent | fd6a74e8ca1f5ded2a760b8ac644124862d80d54 (diff) | |
Collapse redundant "deleted_at" timestaps and "deleted" event instants.
These were separated as there wasn't an obvious way to serialize two fields with the same _type_ with different _prefixes_. Turns out this is a common problem, and someone's written a crate for it that remaps the names for you.
Diffstat (limited to 'src/conversation/history.rs')
| -rw-r--r-- | src/conversation/history.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/conversation/history.rs b/src/conversation/history.rs index 601614c..746a1b0 100644 --- a/src/conversation/history.rs +++ b/src/conversation/history.rs @@ -4,12 +4,11 @@ use super::{ Conversation, Id, event::{Created, Deleted, Event}, }; -use crate::event::{Instant, Sequence}; +use crate::event::Sequence; #[derive(Clone, Debug, Eq, PartialEq)] pub struct History { pub conversation: Conversation, - pub deleted: Option<Instant>, } // State interface @@ -58,7 +57,7 @@ impl History { } fn deleted(&self) -> Option<Event> { - self.deleted.map(|instant| { + self.conversation.deleted.map(|instant| { Deleted { instant, id: self.conversation.id.clone(), |
